LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-08-2010, 08:47 AM   #1
turf
Member
 
Registered: Nov 2009
Posts: 94

Rep: Reputation: 15
how do i set up LAMP?


i did install it correctly because when i typed localhost in the adress bar it opens this
Code:
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
so i create a phpinfo.php file and inside it is
Code:
<?php phpinfo();?>
but instead of displaying php information, it tries to download the phpinfo.php file. why?

Last edited by turf; 11-08-2010 at 08:48 AM.
 
Old 11-08-2010, 08:51 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

Did you edit the appropriate httpd.conf file to make sure php is correctly interpreted?

Building a LAMP Server, look for the section called: Edit the Apache Configuration File (httpd.conf)

Hope this helps.
 
Old 11-08-2010, 09:19 AM   #3
turf
Member
 
Registered: Nov 2009
Posts: 94

Original Poster
Rep: Reputation: 15
Quote:
Download $ lynx http://httpd.apache.org/download.cgi
Extract $ gzip -d httpd-NN.tar.gz
$ tar xvf httpd-NN.tar
$ cd httpd-NN
Configure $ ./configure --prefix=PREFIX
Compile $ make
Install $ make install
Customize $ vi PREFIX/conf/httpd.conf
Test $ PREFIX/bin/apachectl -k start
okay so i'm now in ./configure --prefix=PREFIX and i'm not sure what this mean. it returns this error
Quote:
configure: error: expected an absolute directory name for --prefix: PREFIX
what should the command be? i just literally hit ./configure --prefix=PREFIX

too newbie here.
 
Old 11-08-2010, 09:29 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

If I understood your first post correctly, you already have a working lamp (ok, some configuration issues still need to be solved).

- Why did you start over again?

This: Customize $ vi PREFIX/conf/httpd.conf is the step you need to look at. Use the info I gave in post #2.

Hope this helps.
 
1 members found this post helpful.
Old 11-08-2010, 09:33 AM   #5
turf
Member
 
Registered: Nov 2009
Posts: 94

Original Poster
Rep: Reputation: 15
but there's nothing to edit in my /etc/httpd.conf.. nothing is in there
 
Old 11-08-2010, 09:35 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

/etc/httpd.conf is the incorrect location.....

Look for the /etc/apache directory. It (httpd.conf) should be there or in one of the subdirectories (probably /etc/apache/conf).

Hope this helps.

BTW: Which install document did you use?
 
Old 11-08-2010, 09:43 AM   #7
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Quote:
Originally Posted by druuna View Post
Hi,

If I understood your first post correctly, you already have a working lamp (ok, some configuration issues still need to be solved).

Why did you start over again?
If I can recall correctly, the OP has Apache working but not PHP and not MySQL. But I prefer SQLite over MySQL anyway.

What Linux distro, OP, do you have? Ubuntu? Fedora? Mint? SuSE? Slackware? Arch? PCLinuxOS? If it's any of these, you *don't* have to build PHP from source. And especially if you don't have Slackware, you can just install it from the package manager and you're all set.

For Ubuntu:

Code:
sudo apt-get install php5
For Fedora:

Code:
su -c "yum install php5"
For Mint, follow the Ubuntu instructions. Also for Debian.

For SuSE, open YaST and search for "php".

For Slackware, it's a little bit trickier. You have to download the package (hopefully from the Slackware site) and then install it manually using Slackware's package manager, hoping there's no dependencies to deal with.

For Arch:

Code:
pacman -Sy php5
I don't know the command on PCLinuxOS, but it's just one Google away.

Hope this helps.
 
0 members found this post helpful.
Old 11-08-2010, 09:49 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
@Kenny_Strawn: The OP doesn't mention mysql, so don't go assuming that it is or isn't installed....

The description of the problem points to an apache configuration issue. No need to (re)install anything at this point, just edit the appropriate configuration file and the issue is probably fixed.

Please don't make things more complicated then they are......
 
Old 11-08-2010, 10:01 AM   #9
turf
Member
 
Registered: Nov 2009
Posts: 94

Original Poster
Rep: Reputation: 15
i have /etc/apache2/conf.d/
these are the three files in it. not sure which is to edit and insert AddType application
Quote:
conf.d # ls
charset localized-error-pages security
Quote:
linux conf.d # cat charset
# Read the documentation before enabling AddDefaultCharset.
# In general, it is only a good idea if you know that all your files
# have this encoding. It will override any encoding given in the files
# in meta http-equiv or xml encoding tags.

#AddDefaultCharset UTF-8
linux conf.d #
Quote:
conf.d # cat localized-error-pages
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# Putting this all together, we can internationalize error responses.
#
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
# our collection of by-error message multi-language collections. We use
# includes to substitute the appropriate text.
#
# You can modify the messages' appearance without changing any of the
# default HTTP_<error>.html.var files by adding the line:
#
# Alias /error/include/ "/your/include/path/"
#
# which allows you to create your own set of files by starting with the
# /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
# even on a per-VirtualHost basis. If you include the Alias in the global server
# context, is has to come _before_ the 'Alias /error/ ...' line.
#
# The default include files will display your Apache version number and your
# ServerAdmin email address regardless of the setting of ServerSignature.
#
# WARNING: The configuration below will NOT work out of the box if you have a
# SetHandler directive in a <Location /> context somewhere. Adding
# the following three lines AFTER the <Location /> context should
# make it work in most cases:
# <Location /error/>
# SetHandler none
# </Location>
#
# The internationalized error documents require mod_alias, mod_include
# and mod_negotiation. To activate them, uncomment the following 37 lines.

#<IfModule mod_negotiation.c>
# <IfModule mod_include.c>
# <IfModule mod_alias.c>
#
# Alias /error/ "/usr/share/apache2/error/"
#
# <Directory "/usr/share/apache2/error">
# AllowOverride None
# Options IncludesNoExec
# AddOutputFilter Includes html
# AddHandler type-map var
# Order allow,deny
# Allow from all
# LanguagePriority en cs de es fr it nl sv pt-br ro
# ForceLanguagePriority Prefer Fallback
# </Directory>
#
# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
# ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
# ErrorDocument 410 /error/HTTP_GONE.html.var
# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
# ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
# </IfModule>
# </IfModule>
#</IfModule>
linux conf.d #
Quote:
conf.d # cat security
#
# Disable access to the entire file system except for the directories that
# are explicitly allowed later.
#
# This currently breaks the configurations that come with some web application
# Debian packages. It will be made the default for the release after lenny.
#
#<Directory />
# AllowOverride None
# Order Deny,Allow
# Deny from all
#</Directory>


# Changing the following options will not really affect the security of the
# server, but might make attacks slightly more difficult in some cases.

#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of: Full | OS | Minimal | Minor | Major | Prod
# where Full conveys the most information, and Prod the least.
#
#ServerTokens Minimal
ServerTokens OS
#ServerTokens Full

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
#ServerSignature Off
ServerSignature On

#
# Allow TRACE method
#
# Set to "extended" to also reflect the request body (only for testing and
# diagnostic purposes).
#
# Set to one of: On | Off | extended
#
TraceEnable Off
#TraceEnable On

linux conf.d #
 
Old 11-08-2010, 10:09 AM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

@Kenny_Strawn: A good helpful guide;

How to Answer a Linux Question is Simon Bridge's excellent composition to aid us in good informational exchanges.

A good related guide;
How To Ask a Question by XavierP & GrapefruiTgirl is a Great LQ post that is abbreviated from the original by Raymond & Moen.

I must agree that you are imposing information that may be related but not applicable to the OP's original query. Just causes the thread to be convoluted.
 
Old 11-08-2010, 10:12 AM   #11
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

@OP;

LAMP is a Web development platform based on Linux, Apache, MySQL, and PHP, a programming language for which Perl or Python is sometimes substituted.' Look at the LAMPwiki.

 
Old 11-08-2010, 10:16 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

Strange that you do not have a httpd.conf file.....

Anyway, you can probably create a new entry: /etc/apache2/conf.d/php

Put the following in it:
Quote:
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php5_module modules/libphp5.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#

AddType application/x-httpd-php .php .htm .html

#
# Add index.php to the list of files that will be served as directory
# indexes.
#

DirectoryIndex index.php index.htm index.html

# end
Restart apache and check to see if all is ok.
 
Old 11-08-2010, 10:18 AM   #13
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
Quote:
Originally Posted by Kenny_Strawn View Post
For Slackware, it's a little bit trickier. You have to download the package (hopefully from the Slackware site) and then install it manually using Slackware's package manager, hoping there's no dependencies to deal with...Hope this helps.
No, it doesn't. PHP is already included in Slackware.
 
Old 11-08-2010, 10:20 AM   #14
jkzfixme
Member
 
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Blog Entries: 21

Rep: Reputation: 52
The problem is that if you do have php installed it is not parsing the data correctly. If you do already have php installed you need to do the following to allow apache to recognize the mime types


Quote:
vi /etc/apache2/mods-available/dir.conf
Quote:
<IfModule mod_dir.c>

DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml

</IfModule>
Quote:
/etc/init.d/apache2 restart
 
Old 11-08-2010, 10:07 PM   #15
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,333
Blog Entries: 12

Rep: Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729
If you are using Lampp, Lampp's configuration files are all under /opt/lampp/etc.

Any files in /etc are irrelevant to it. Lampp/Xampp is completely self-contained.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LAMP set up in Ubuntu10.04-rev189 and CRONJOB ankured182 Linux - Newbie 1 07-13-2010 02:08 AM
Wish to set up LAMP on old 486, for learning :) 2fer LinuxQuestions.org Member Intro 5 06-16-2008 11:03 AM
Help needed to set up LAMP harrybazeegar Linux - Server 8 05-12-2008 03:33 AM
1st Timer wants to set up LAMP on SuSe Mikeybabyflip SUSE / openSUSE 1 07-19-2007 06:54 PM
lamp set up shankarLe Linux - Server 9 06-30-2007 01:48 AM


All times are GMT -5. The time now is 08:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration