LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-28-2008, 09:24 PM   #1
Phr34Ck
LQ Newbie
 
Registered: Feb 2008
Location: Lebanon
Distribution: Arch, Debian, Ubuntu, CentOS
Posts: 13

Rep: Reputation: 0
Compiling Apache, PHP and MySQL from source.


Hello everyone,

I'm using CentOS4 x86_64, and I want to compile/install Apache, Php and MySQL from the source code.

I have downloaded and untarred all three softwares, but I'm not understanding what options should I include. This is the first time I compile form source, and I'm doing it because I want to have some experience, and because YUM does not offer the latest releases of these softwares.

I have downloaded the source code to ~/sourcecode/ folder. I have a basic experience, as I tried to compile apache once.

My question is: What kind of options do you recommend? and what should be compiled before the other?

so far, I have gathered these information: Apache first, then MySql, then php. I know the --prefix option, and something about apsx, which I have no idea what that is. For PHP, I think there is --with-mysql or something...

And what about security? I always read that each process (apache, php, mysql) should be run on different useraccount with tight privileges. Any of you have experience in that? and how do I exactly do it?

Thanks a lot for your time.
 
Old 02-29-2008, 01:11 AM   #2
Phr34Ck
LQ Newbie
 
Registered: Feb 2008
Location: Lebanon
Distribution: Arch, Debian, Ubuntu, CentOS
Posts: 13

Original Poster
Rep: Reputation: 0
Okay, after reading a little, I did the following:

For apache: ./configure --prefix=/wwwroot --enable-so --enable-cgi --enable-info --enable-rewrite --enable-speling --enable-usertrack --enable-mime-magic

For Php: ./configure --prefix=/wwwroot/php --with-apxs2=/wwwroot/bin/apxs --with-config-file-path=/wwwroot/php --with-zlib --disbale-cgi --with-gettext

I couldn't compile MySQL. I'm trying to figure out how ....

Is there a way to enable MySQL later on when I compile it? As you noticed, I didn't use --with-mysql when compiling PHP.
 
Old 02-29-2008, 02:30 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
I couldn't compile MySQL. I'm trying to figure out how ....
Are you sure you've downloaded the sources. Because the common mysql software you can d/l from mysql.com is the binary. If it is the source you can install it with the usual procedure ./configure, make, make install. If it's the binary read the included INSTALL file to see how to install it.
Quote:
Is there a way to enable MySQL later on when I compile it? As you noticed, I didn't use --with-mysql when compiling PHP.
You should recompile php to include mysql support
 
Old 02-29-2008, 02:33 AM   #4
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
you can install mysql whenever you want or need. You can take a binary version too. They are compiled with intel compiler and tend to run faster than those built with gcc. The --with-mysql would have been useful if you intend to connect to mysql from php...
 
Old 02-29-2008, 05:03 AM   #5
Phr34Ck
LQ Newbie
 
Registered: Feb 2008
Location: Lebanon
Distribution: Arch, Debian, Ubuntu, CentOS
Posts: 13

Original Poster
Rep: Reputation: 0
I have compiled them all . MySQL required gcc-c++ which I didn't have. Now I'm facing another problem. I cannot find my.conf so I could use MySQL ;p. I'm having this error:
Quote:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
 
Old 02-29-2008, 05:28 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You can search the support-files/ subdirectory where you've compiled mysql for various my-whatever.cnf. Pick the one that matches your needs and copy it in /etc, or under the subdir etc/ in the directory you've installed mysql.
Quote:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
Make sure you did all the necessary steps before starting the server for the first time. You should give apropriate permissions to the databases directory and use the supplied scripts to create initial tables.
You can also search LQ for this error to find more answers.

Regards
 
Old 02-29-2008, 06:05 AM   #7
Phr34Ck
LQ Newbie
 
Registered: Feb 2008
Location: Lebanon
Distribution: Arch, Debian, Ubuntu, CentOS
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks a lot bathory. I'm still battling my way through. I've tried to search the subdirectories after installation, but I couldn't find anything. I will read the mysql docs later on. Thanks though.
 
  


Reply



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
Open source IDE for PHP, MySQL, Apache, Red Hat 9 lothario Red Hat 2 06-02-2010 02:27 AM
php/shell script to install mysql,apache and php automatically stranger_6_7 Linux - General 2 08-11-2009 02:07 AM
Compiling PHP +mysql + apache Kupo Linux - Software 2 06-16-2007 03:46 AM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM
Compiling Apache, MySQL, Perl & PHP jeucken Linux - Software 1 12-15-2003 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:05 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
Open Source Consulting | Domain Registration