Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 10th, 2002, 09:02 AM
kjedwards kjedwards is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 76 kjedwards User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 15 sec
Reputation Power: 8
PHP, MySQL under Redhat Linux 7.2

Hi

I have just installed Redhat Linux 7.2 - installed with every package, module included on the RedHat CD's.

Can someone please tell me how to set up PHP 4.2.2 and mySQL to run under Apache?

I am confused because the php.net site seems to suggest installing together with Apache, but isn't Apache already installed as part of the RedHat install?

Thanks

Kevin

Reply With Quote
  #2  
Old August 12th, 2002, 02:01 AM
Ted Striker Ted Striker is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 409 Ted Striker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Depends on how you installed Red Hat in the first place.

When I did a custom install, you had to tell Red Hat to install all of those apps specifically. I think Apache was listed under, "daemons."

Reply With Quote
  #3  
Old August 12th, 2002, 09:34 AM
comidio comidio is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 11 comidio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool

if you chose everything then more than likely RH installed Apache (check the /usr/local/ directory or do a search for apache this will tell you where it is) or check the processes to see if the httpd daemon is running;

ps -aux | grep httpd

I think PHP is apart of the default apache install (I am fuzzy on a lot of what is default because I roll my own), once you are sure apache is running. So you might just need to install php as a module and MySQL.

Let us know what happens.

Side note NEVER install everything this makes for a very dangerous box especially if it is connected to the Internet.

Reply With Quote
  #4  
Old August 12th, 2002, 03:06 PM
kjedwards kjedwards is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 76 kjedwards User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 15 sec
Reputation Power: 8
Hi

Thanks for that.

Apache is installed and I think I managed to install mysql. I still need to install a couple of additional modules to get mysql working with php but the RedHat FTP site seems to be unavailable so I cannot download them

One thing I don't understand though is where you create and place your web pages in the Linux file structure?

On my Win2k PC I have seperate folders - Apache, mySQL, PHP, etc and another called www. I create new web sites in the www folder. So to access from a browser I just type localhost/www/site1 etc and away I go.

How, where do you put the web sites under Linux so Apache, etc can find them? I find the file structure on Linux rather intimidating!

Thanks

Kevin

Reply With Quote
  #5  
Old August 12th, 2002, 03:41 PM
telex4's Avatar
telex4 telex4 is offline
Wacky hack
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 512 telex4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 25 m 29 sec
Reputation Power: 8
If you look at /etc/httpd/httpd.conf and find the line with "ServerRoot" in, that tells you the root directory for your web server. You then use that directory as you would in Windows, so you might put "site1" in there, and then go to http://localhost/site1

Btw a nice tip, you can use locate and grep to find the file, and look for that line very quickly:

locate httpd.conf
grep ServerRoot /path/to/httpd.conf

This tutorial should help you get to grips with the filesystem, and where files generally go.

Reply With Quote
  #6  
Old August 12th, 2002, 04:36 PM
kjedwards kjedwards is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 76 kjedwards User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 15 sec
Reputation Power: 8
Hi

Thanks I will give it a go.

Can you tell me does Apache get started on Linux start-up, I cannot seem to see it but it is definitely installed?

Thanks

Kevin

Reply With Quote
  #7  
Old August 12th, 2002, 04:49 PM
telex4's Avatar
telex4 telex4 is offline
Wacky hack
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 512 telex4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 25 m 29 sec
Reputation Power: 8
It might or might not being starting up automatically. As comido said, the way to find out if it is running is by using:

ps -aux | grep httpd

If its not, then check whatever tool RedHat uses to manage daemons to see set Apache to start automatically. I don't know much about RedHat, so someone else will have to explain how RedHat managed its rc files...

Reply With Quote
  #8  
Old August 12th, 2002, 07:28 PM
kjedwards kjedwards is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 76 kjedwards User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 15 sec
Reputation Power: 8
Hi

I think I sorted it!

Apache doc are served from the Document Root, in my install version of Apache 1.30.2 this is at /var/www/html/

I will change this to /var/www/

Then create sub directories under this ie mysite1 , etc

I also found where to set Apache to start on boot up.

One thing though, serving web pages (even from localhost) through Mozilla runs like a arthritic dog! It is much, much quicker on Windows/IE.

I set up a basic echo phpinfo() and noticed the install version of php is 4.0.6 so must now update that to 4.2.2 and mySQL isn't found, so need to install mySQL support in php, probably for Perl as well.

Hopefully I should get this running soon.

Another question (sorry) Assuming I get this machine networked linked to my main development PC, how do I 'see' web pages stored on the Linux box via the browser on my development PC?

Do I just use something like http//Linux Box Network Card IP)/mysite1/? Or do I need to configure something else on the Linux box to route through?

Also is it possible to have my development PC connected to the Internet (I have an ADSL modem link) and simultaneously have access to the Linux box via the LAN cards I will install - hopefully they will arrive tomorrow?

Many thanks for all your help and advice so far - it is much appreciated

Yours

Kevin

Reply With Quote
  #9  
Old August 12th, 2002, 08:28 PM
telex4's Avatar
telex4 telex4 is offline
Wacky hack
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 512 telex4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 25 m 29 sec
Reputation Power: 8
I havee no idea why Apache servers content so slowly for you, its always been really fast for me. Ask some Apache experts I suppose, or RedHat experts, or just people experienced with Apache in GNU/Linux

Yes, as you guessed, to get the pages from other machines, you just type http://IP/page . It's exactly like the Internet... you are using HTTP afterall. If you want to get overly fancy you can set-up a DNS server and be able to type http://hostname/page without ever registering a domain (though it will only work for your local network of course lol). The only thing that might stop your fun would be the Apache config file... just make sure you've got permissions set correctly if things don't want to work.

Finally, your Internet connection... I'm not *entirely* sure what you mean here... if you have another (Windows?) PC connected to the Internet, and you connect your sever to that, then you'll proably want to set-up a Proxy server on the PC connected to the Internet, and tell any programs that might use the net on you GNU/Linux box to use the Proxy. A better solution, if you have a old box, or $50-100 to buy one, and especially if you have a broadband connection, is to set-up a gateway running something like OpenBSD, and setit up to route all Internet traffic seamlessly around your network, so you just plug a computer into the network, and you're on the 'Net, without a problem But that's a little more advanced, for now

Reply With Quote
  #10  
Old August 12th, 2002, 08:37 PM
comidio comidio is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 11 comidio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool

First the slowness isn't the fault of Apache is quick, but that is something to worry about later let's get the LAMP on first.
With the MySQL are you sure that it is running? If you are unsure there is a daemon called mysqld, find out with:
ps -aux | grep mysqld

To answer you second question you should be able access the site via http://localIP/webfolder. Or if you want to get tricky, modify the hosts file on the client machine (windows has one to) this is the first place most computers look for DNS info, the syntax is
IP_address computername
In UNIX/Linux it is located in /etc/hosts, on windows it is buried in the c:\Windows\system32\~\etc\hosts. The ~ is the part of the path I can't remember, I don't have windows box up right now to check, that would the most fun way. And you shouldn't have a problem with having the network attached to the internet. The only way this might be a problem is if you are using an external IP address or a domain name that is registered and you don't have your hosts files configured. Good luck.

Reply With Quote
  #11  
Old August 12th, 2002, 08:42 PM
comidio comidio is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 11 comidio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face

Whoops!!! looks like telex4 beat me to the punch on that reply.

Reply With Quote
  #12  
Old August 13th, 2002, 03:27 AM
kjedwards kjedwards is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 76 kjedwards User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 15 sec
Reputation Power: 8
Hi

Thanks for that

I think the mySQL problem is with the php.ini file, plus I am missing a module (still cannot access the RedHat FTP site).

I will need to dig into that a little deeper.

To clarify I have two PC's -

1. running win2k, Apache, etc, connected to Internet via ADSL

2. running RedHat Linux 7.2 (I deleted win95 - loved that bit!), no Internet connection.

I have ordered 2 LAN cards, plus hub and cables.

My idea was to use PC 1 to have simultaneous access to Internet and PC 2. That way I can access Internet and any files on PC 2 without swopping connections.

I had a set up like this at my ex-works (set up by their IT Comms), a development PC permanently connected to the Internet and also connected into a server. It means you can develop apps, save them to the server but also keep the Internet connection open.

I really want to have something like that. It makes life easier and if you add another PC later you can instantly access all apps on the server.

If there is a way to allow PC 2 to access the Internet through PC 1 as well that would be wonderful!

I think it is Mozilla that is very slow, never had a problem with Apache even when I was running it on a very low spec PC.

I will have a look for some info regarding Proxy Servers. I think the OpenBSD solution is a little beyond me at the moment.

Thanks again

Yours

Kevin
PS I ordered the 'Running Linux' book should arrive in a day or so.

Reply With Quote
  #13  
Old August 13th, 2002, 06:24 AM
telex4's Avatar
telex4 telex4 is offline
Wacky hack
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 512 telex4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 25 m 29 sec
Reputation Power: 8
Yes, what you want to do will be easy. You will just network the two PCs (LAN card in each, connect them both to your hub, check configs, ping to check they're connected, and you're done). That's it Working on PC 1 you'll then be able to access files on PC 2 at the same time as accessing the Internet.

One thing that might be worth doing is getting "ssh" running on your RedHat machine (which is probably is already anyway, just look for "sshd" using "ps" in the same way we mentioned for other processes). Then you'll be able to remotely log into your RedHat machine from your Win2k machine (install a program called "Putty" on your Win2k machine for a nice client to ssh into the RedHat machine). You'll then never have to leave your seat, and will be able to work on both machines without needing physical access to the RedHat machine

Reply With Quote
  #14  
Old August 13th, 2002, 07:01 AM
kjedwards kjedwards is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 76 kjedwards User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 15 sec
Reputation Power: 8
Hi

Thanks again.

The hardware has arrived for the network so I will give that a go later today. Never installed or configed a LAN Card before so that will be fun.

Thanks for the info regarding ssh and Putty. (I think ssh is already installed)

Yours

Kevin

Reply With Quote
  #15  
Old August 13th, 2002, 09:21 AM
comidio comidio is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 11 comidio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink

telex4 is absolutely right about the SSH I have always set up my boxes that way. All my *nix servers sit in the corner with out the need for monitors. BUT for a later date to have fun you can set up remote access for Xwindows. You will need to get a client for you Windows box, but this will give you access to the Linux GUI desktops. Just a suggestion and one that I haven't even taken up. Good Luck!!

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > PHP, MySQL under Redhat Linux 7.2


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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