LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-19-2003, 11:44 AM   #1
kaustav
LQ Newbie
 
Registered: Nov 2002
Posts: 14

Rep: Reputation: 0
Question Setup Apache and PHP


Hi,

I have installed Red Hat 8. I also have installed MySQL, Apache and PHP as found in the packages. So far I've been able to configure and run MySQL. I am able to create a database, create tables, run SQL and stuff.

The problem is I can't figure out how to start off with Apache. I had specified the settings in the Apache Configuration Applet(GUI) to the best of my knowledge. I also have started the httpd server and it starts okay.

I need to be able to host a site locally in my computer which would be using PHP/MySQL. I need to know the following -

1. What all is required to setup configure Apache Server.
2. What should I specify as the Server Name while configuring Apache - should it be something like "mycomputer" or "www.mycomputer.com"
3. What all is required to setup configure PHP with MySQL.
4. Where do I copy / create the website files(htm,php) - and in which directory/folder.
5. What would be the required permissions on them.
6. Where do I specify the virtual directory name for the site (something like http://localhost/mysite)
7. How do I get to PHYMyadmin.

Thanks.
 
Old 03-19-2003, 01:13 PM   #2
-G-
LQ Newbie
 
Registered: Mar 2003
Location: North West USA
Distribution: Redhat 8.0 & 9.0, Mandrake 9.0 & 9.2, Fedora Core 1, Knoppix
Posts: 28

Rep: Reputation: 15
Re: Setup Apache and PHP

Quote:
Originally posted by kaustav
Hi,

I have installed Red Hat 8. I also have installed MySQL, Apache and PHP as found in the packages. So far I've been able to configure and run MySQL. I am able to create a database, create tables, run SQL and stuff.

The problem is I can't figure out how to start off with Apache. I had specified the settings in the Apache Configuration Applet(GUI) to the best of my knowledge. I also have started the httpd server and it starts okay.

I need to be able to host a site locally in my computer which would be using PHP/MySQL. I need to know the following -
See if I can address your questions. I've just done a similar setup, but I'm still a newbie. Hopefully this can get worked out here.

Quote:
1. What all is required to setup configure Apache Server.
I believe you have to edit the apache.conf file. I *think* this is in the /usr/local/apache/bin directory....(?) for Apache 1.3. I can't remember where it is for Apache 2.0. The conf file is pretty well documented with tons of comments. I found it easy to navigate. I don't use the GUI for the config of the apache server, so I can't address any questions concerning that end of the setup.

Quote:
2. What should I specify as the Server Name while configuring Apache - should it be something like "mycomputer" or "www.mycomputer.com"
Can't help here...sorry. I'm not exactly sure what you mean.

Quote:
3. What all is required to setup configure PHP with MySQL.
Check out these two links. They were key in my setup process.

LAMP installation HOWTO

Dev Shed Article on setting up Apache, SSL, MySQL and PHP

Quote:
4. Where do I copy / create the website files(htm,php) - and in which directory/folder.
The default DocumentRoot, which is the directory that apahce looks into when it gets an html requet is /usr/local/apache/htdocs for Apache 1.3. For Apahce 2.0, I think the default is something like /var/www or some such thing...anyway, it's in the final directory of www.

Quote:
5. What would be the required permissions on them.
Again, I'm no help here.

Quote:
6. Where do I specify the virtual directory name for the site (something like http://localhost/mysite)
I've seen a ton of Virtual Server HOWTO's on the net. A quick google may answer most of your virtual hosting stuff.

Quote:
7. How do I get to PHYMyadmin.
Not sure what this is...again, I'm too new to be much help

Quote:
Thanks.
Sounds like you are well launched into it. Good luck and keep us posted on your progress.

-G-
 
Old 03-19-2003, 02:25 PM   #3
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
The configuration file for Apache is in /etc/httpd/conf/httpd.conf.

There is a section at the top of this file that you have to enter the ip/hostname of the server to listen to. If you have a real qualified domain name you can put it there or if you just want local lan access, you can set up name resolution and make up some name. If you have a static ip you can put it there instead. If you don't know what you're doing, I would use the ip address of the machine. ex. Listen xxx.xxx.xxx.xxx 80

Your html files should go in /var/www/html/

You can setup virtual servers using in the httpd.conf file.

As a piece of advice, there are alot of in's and out's to apache that can be tricky. Go buy a book on apache2.0 as a reference. I would recommend Professional Apache2.0 from Wrox. It will walk you through pretty much everything you need to know about apache.
 
Old 03-19-2003, 11:31 PM   #4
kaustav
LQ Newbie
 
Registered: Nov 2002
Posts: 14

Original Poster
Rep: Reputation: 0
Hi -G- and Capt_Caveman,

thanks a lot. I'll check these out and get back in case I have any issues. Best Regards.
 
Old 03-21-2003, 01:25 AM   #5
maildhanraj
LQ Newbie
 
Registered: Sep 2002
Location: pune
Distribution: Rh7.2
Posts: 12

Rep: Reputation: 0
hey kaustav,
For the GUI mod configuration if u dont have any x windows then u can use the linuxconf util . to configure the server in that (linuxconf) u will find a option for the enable network access of linuxconf after confi. that u will be able to configure all the server ( apache , network , NFS , Samba , firewall ) from a client browser by giving the server ip / name in the client browsers address bar , well but remeber that doing configuration from there will over write the orignal file .
 
Old 03-31-2003, 07:23 PM   #6
ZFighteR
LQ Newbie
 
Registered: Dec 2002
Location: Rhode Island
Distribution: Redhat 9 (Psyche)
Posts: 26

Rep: Reputation: 15
I can solve the problem about the PHPMyAdmin it can be found on http://www.phpmyadmin.net . It is a PHP based web page that lets you change everything having to do with your MySql Server. I highly recommond it for a newbie it is great and works great. Just untar the files into a dir called "phpmyadmin" or soemthing like that in your apache webpage directory. After that just point your web browser to the index.php file in the PHPMyAdmin dir. IE: "http://localhost/phpmyadmin/index.php" localhost is where you would put either your server's domain name or the ip address of your webserver on the network. Also MySql aslo provides a GUI Control Center witch is really nice.

Last edited by ZFighteR; 03-31-2003 at 07:33 PM.
 
  


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
PHP/MySQL and Apache server setup nenyo Linux - Software 7 02-12-2005 02:48 PM
apache or php setup problem caged Linux - Software 2 10-28-2004 07:29 PM
Apache/PHP/MySQL Setup Help jobless_joe Linux - Software 2 05-30-2004 02:55 PM
PHP Setup in Apache stevem00 Linux - Software 2 01-16-2004 04:59 PM
Apache PHP MySQL Setup after Slackware 9.0 Installation initself Slackware 37 12-20-2003 07:48 AM


All times are GMT -5. The time now is 09:12 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