Hi All,
I've spend hours and hours looking for an easy way to setup fedora 3 as a simple web server. I couldnt really find anything, so I started using what information I found to do it myself and I noted down everything I did to get it all working.
I'm going to share it with everyone here, I'm not saying this is perfect, nor is it the correct way to do this, but it worked for me and hopefully it should work for others too.
Please feel free to correct any mistakes or suggest easiers ways to do things.
=================================================
Install Fedora core 3.
Selecting to install Web server, mysql, mail server, ftp, and other server packages I thought I might use one day. My
installation came to about 3GB
Once installation was complete. Log in as root.
INSTALLING MYSQL CLIENT
=======================
# yum install mysql
Yum downloaded some updated files for itself
I was asked "Is this OK?" I entered "y"
Yum downloaded the mysql client, took about 10 minutes
INSTALLING MYSQL SERVER
=======================
#yum install mysql-server
yum downloaded some stuff
I was asked "Is this OK?" I entered "y"
Yum downloaded the mysql server, took about 1 minute
SETTING UP MYSQL
================
# usr/bin/mysql_install_db
I found that MYSQL wouldnt run at this stage, so I had to do the following...
# vi /etc/my.cnf
press the 'insert' key
add the following line in the [mysqld] section
skip-innodb
Press the [ESC] key to cancel editing, then enter ':wq' this saves the file and quits
I needed to change some permissions on some directories so that MYSQL could create a mysql.sock file.
# chown -R mysql /var/lib/mysql
# chgrp -R mysql /var/lib/mysql
DISABLE SELINUX
===============
There are known conflicts with MySql and SELinux, so I disabled SELinux.
# /usr/bin/setenforce 0
That last line disabled SELinux
# vi /etc/selinux/config
Set "SELINUX=disabled" in the config file. To do this press the [INSERT] key, make the changes, press the [ESC] key, then
enter ':wq'
The restart mysql with the following command.
SETUP A NEW USER ON FEDORA
=======================
I'm not sure if this bit is 100% correct as I forgot to add this bit to my tutorial. Replace username with the username you want to use.
# useradd username -d /var/www/html
# passwd username
You will be asked to enter a password, don't worry if it says its a bad password, it'll still work.
STARTING MYSQL
==============
# /usr/bin/mysqld_safe --user=mysql &
RESETTING THE MYSQL ROOT USER PASSWORD
======================================
# /usr/bin/mysqladmin -u root password 'mypasswordhere'
SETTING UP A NEW USER ON MYSQL
==============================
Login to mysql
# mysql --user=root -p mysql
Enter password when asked, this is the password I just reset.
Below, replace the word username with the account we created in the section called 'SETUP A NEW USER ON FEDORA.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
Exit mysql by typing 'quit'
INSTALL PHP-MYSQL
=================
This I believe installs the link between php and mysql to allow php to use mysql.
# yum install php-mysql
Then I needed to restart apache
#apachectl restart
INSTALLING PHPMYADMIN
=====================
# wget
http://heanet.dl.sourceforge.net/sou...6.3-pl1.tar.gz
This downloads the file
# gzip -d phpMyAdmin-2.6.3-pl1.tar.gz
This de-compresses the gzip file
# tar xvf phpMyAdmin-2.6.3-pl1.tar
This extracts all the files required for phpmyadmin into a directory called phpMyAdmin-2.6.3-pl1
# mv phpMyAdmin-2.6.4-pl1 phpmyadmin
The last command renames the phpmyadmin directory to simply phpmyadmin (its easier to remember).
EDIT THE PHPMYADMIN CONFIG FILE
===============================
# vi /var/www/html/phpMyAdmin/config.inc.php
Locate the following lines.
change the absolute url
$cfg['PmaAbsoluteUri'] = 'http://www.littlened.co.uk/phpMyAdmin-2.6.3-pl1/';
then change the username and password.
$cfg['Servers'][$i]['user'] = 'enter your mysql username'; // MySQL user
$cfg['Servers'][$i]['password'] = 'enter your mysql password'; // MySQL password (only needed
change the details to the mysql username and password just created by Pressing [INSERT], make the changes and then press
[ESC], and enter ':wq'
Phpmyadmin should be accessible now at
http://127.0.0.1/phpmyadmin/
SETUP APACHE & MYSQL TO START AT BOOT
=====================================
# chkconfig httpd on
# chkconfig mysqld on
SETTING UP DNS EXIT DYNAMIC DNS
===============================
As I have dynamic DNS, I registered with DNSExit.com.
Lynx is required for this to run
# yum install lynx
# cd /usr/local/bin
# wget
http://serve.me.nus.edu.sg/limcg/ip_update/getipd
# chmod 755 getipd
# vi getipd
Edit the DNSexit username and password etc by pressing the [INSERT] key, make the changes, then press [ESC] and enter ':wq'
# cd /etc/init.d
# wget
http://serve.me.nus.edu.sg/limcg/ip_update/gipd
# chmod 755 gipd
# chkconfig --add gipd
# service gipd start
SETTING UP PORTS
================
If you have a router you will need to open the following ports and forward them to the IP address of your new Fedora
installation.
80 - Apache
21 - FTP
22 - SSH
FINAL THOUGHTS
============
If at this stage things are not working, try the following commands.
# service httpd restart
# service mysqld restart
If things still dont work, post a message on linuxquestions.org