Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.).
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')
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).
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.