LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 05-16-2005, 04:49 PM   #1
c_ryan
LQ Newbie
 
Registered: May 2005
Posts: 5

Rep: Reputation: 0
Trying to setup a LAMP using Fedora 3


Hi,
I'm trying to setup Apache2, MySQL 4.1 and PHP (5 preferably) on a fresh install of Fedora Core 3. I've got Apache2 and MySQL working, but I can't seem to figure out how to install PHP. I realise that I need to compile it (I suppose I must?), and end up with it as an Apache2 module, rather than a CGI executable. In order to do so, it looks like I need apxs2? Anyway, I'm very new to all this so any help would be appreciated. I'm going to need the functionality of some of the PHP modules (exif, gd, mysql etc.).

Thanks,
 
Old 05-17-2005, 12:12 PM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,506

Rep: Reputation: 100Reputation: 100
Hi!

Do MYSql first, then Apache, then PHP.

Here is how I installed a LAMP setup on my RedHat 9.0 system:

Mysql:

1. Install according to BINARY_INSTALL.TXT
2. Do chown -R mysql.mysql /var/lib/mysql
3. Go to /var/run
4. mkdir mysqld
5. chown -R mysql.mysql mysqld
6. Start the server - mysqld_safe --user=mysql & in the /usr/local/mysql/bin/
directory
7. Type in mysql -u root mysql
8. At mysql> prompt type
set password for root@localhost=password('arendia');

Example:

[root@StefanLinux rylan]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.16-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> set password for root@localhost=password('yourpass')

And then, like this for Apache and PHP:

Compile apache:

Apache configure line:
./configure --enable-so --enable-mods-shared=/usr/local/apache2/modules/libphp4.so

Compile PHP:

PHP configure line:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-apache2

Add these to httpd.conf in apache directory apache2/conf

LoadModule php4_module /usr/local/apache2/modules/libphp4.so

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

Also set ServerName to 169.254.255.20:80 (or whatever you server's local self-referencing IP is)

UseCanonicalName On

Create a php.ini in /usr/local/lib which contains

safe_mode="0"

These worked for me for MySQL 4.0.16, Apache 2 and PHP 4.

IF you have further problems post again and I'll see if I can help you out.
 
Old 05-17-2005, 01:19 PM   #3
c_ryan
LQ Newbie
 
Registered: May 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Angry Isn't MySQL wonderful?

Thanks for the reply,
After deciding that I'd messed things up too much, I did a reinstall of Fedora Core 3.
After installing MySQL 4.1 from the standard server binary RPM, I've been unable to progress. It has not created any tables in the mysql schema directory, and I get some quirky errors if I try to run mysql_install_db (see below).

Code:
[root@ryanlinux bin]# mysql_install_db --user=mysql
Installing all prepared tables
050517 16:55:41 [Warning] Asked for 196608 thread stack, but got 126976
mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=8388600
read_buffer_size=131072
max_used_connections=0
max_connections=100
threads_connected=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 225791 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x85d7208
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0xfef5ed18, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x808df77
0x82e8af8
0x85d8798
0x80b3fe1
0x80a2c14
0x809c69e
0x82e62ac
0x830fc3a
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/Us...ack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x85f2938 =  CREATE TABLE db (   Host char(60) binary DEFAULT '' NOT NULL,   Db char(64) binary DEFAULT '' NOT NULL,   User char(16) binary DEFAULT '' NOT NULL,   Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Lock_tables_priv enum('N','Y') COLLATE utf8_genera
thd->thread_id=1
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.
Installation of system tables failed!

Examine the logs in /var/lib/mysql for more information.
You can also try to start the mysqld daemon with:
/usr/sbin/mysqld --skip-grant &
You can use the command line tool
/usr/bin/mysql to connect to the mysql
database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/bin/mysqlbug script!
And my mysql error log

Code:
050517 16:50:25  mysqld started
050517 16:50:25 [Warning] Asked for 196608 thread stack, but got 126976
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
050517 16:50:25  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
050517 16:50:25  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
050517 16:50:25  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
050517 16:50:25  InnoDB: Started; log sequence number 0 0
050517 16:50:25 [ERROR] Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't exist
050517 16:50:25  mysqld ended
Note that this is a fresh install of FC3 x86, with no prior version of MySQL installed, and with SELinux disabled. After searching google for some time, I've found nothing that solves my problem but a whole load of stuff that doesn't. ^^ Anything blindly obvious that I've missed? (I think I can sort out PHP and Apache easily enough if I can get MySQL working).

Last edited by c_ryan; 05-17-2005 at 01:21 PM.
 
Old 05-18-2005, 01:06 PM   #4
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,506

Rep: Reputation: 100Reputation: 100
Hmm - dunno.

Personnaly, I detest .RPM's for installing software. Also, personally I think it is much better to install software from a tar.gz, NOT an
RPM. Just my two cents.

To solve your problem, I think the best approach would be to get a binary MySQL distribution (on which my previous post is based) and
then trying to install that using the steps I outline. I can't remember what is in BINARY_INSTALL.TXT, but if you think that is what is
screwing you up, post again and we can take another look.

But I think the first step is to NOT use the provided RPM, but get a tar.gz binary archive and use that. My RedHat 9 came with MySQL and
Apache included, but bugger-all could I ever get them going. It was lightyears easier just to get my own tarballs and install them
myself. Same goes for Samba, which was also included with Rh9 but which I had no idea how to use. So I got my own off the net. Much better.

BTW, since you used rpm, did you install it like

rpm -ivh mysqlbinaryrpm.prm?

Were there any error messages?

Keep at it - it took me quite a while to get going with LAMP, but once its up you won't ever be sorry.
 
Old 05-19-2005, 09:33 AM   #5
c_ryan
LQ Newbie
 
Registered: May 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for your help,
I found that using the tars for PHP and Apache were easier than messing around with RPMS, but before abandoning the RPMs, I tried one minor version of MySQL older than the latest stable one (4.1.11 I think) and success! It seems that something's wrong with 4.1.12 or for whatever reason my system didn't like it. Anyway, I've got Apache2, PHP5 and MySQL 4.1 setup and working now but I'm having a little trouble setting permissions on the htdocs directory. Apache has a user account set up for it called 'apache'. I use the account 'ryan' to edit files. I want to setup my htdocs directory such that Apache and I can modify, delete, read and create files in the directory. This is easy enough for me to do, but then I am having problems with newly created files. Files I create in the directory (using the ryan account) do not inherit user/group ownership from their parent, which means that Apache cannot read any files I edit with gedit (they get user/group or ryan/ryan). Apache needs write access in some subfolders of htdocs and read access in all, but I don't want to give any access (read, write or execute) to other users.

Any suggestions?
 
Old 05-19-2005, 01:52 PM   #6
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,506

Rep: Reputation: 100Reputation: 100
Quote:
Originally posted by c_ryan
to setup my htdocs directory such that Apache and I can modify, delete, read and create files in the directory. This is easy enough for me to do, but then I am having problems with newly created files. Files I create in the directory (using the ryan account) do not inherit user/group ownership from their parent, which means that Apache cannot read any files I edit with gedit (they get user/group or ryan/ryan). Apache needs write access in some subfolders of htdocs and read access in all, but I don't want to give any access (read, write or execute) to other users.
Any suggestions?
Congrats!

As regards the question:

Hmm - well you need to take a look at chmod (for changing permissions) chown (for changing file ownerships). For example, to make the ryan user the only one that may read htdocs do, as ryan:
ryan#]chmod -R go-rwx htdocs
ryan#]chmod -R u+rwx htdocs

which, if you are logged in as ryan, should make it so that only you can read or write or change (the x) to the directory, IF you own it.

I think you might be able to adres the inhertiance issue by changing the ownership of the htdocs directory to ryan

chown ryan htdocs/

and making it world readable:

chmod -R go+r htdocs/

or, to prevent ppl from reading from it, but still have you and apache accessible in it, make a group (using groupadd) then add yourself and apache to that group. How exactly you do that however I don't know.

You might want to take a look at man groupadd, man chmod, man chown and man groupdel.

Hope this helped a bit!

Last edited by rylan76; 05-19-2005 at 01:53 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
Need help with fedora setup X10A Linux - Newbie 2 05-18-2005 02:13 AM
server setup for lamp, taking 60M page views/month dtra Linux - General 2 03-01-2005 12:37 AM
new lamp on fedora 2 rblampain Linux - Software 5 12-06-2004 01:16 AM
Puresecure install with existing LAMP setup-- Possible? opioid Linux - Software 1 10-27-2004 12:21 PM
LAMP & Qmail install on RedHat/Fedora 88guy Linux - Newbie 0 05-28-2004 01:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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