LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 07-14-2005, 04:13 AM   #1
fuelinjection
Member
 
Registered: Nov 2003
Location: County Durham, England
Distribution: Fedora
Posts: 238

Rep: Reputation: 30
Tutorial: how to setup a web server with fedora 3


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
 
Old 07-14-2005, 08:55 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Moved: More suitable in Success Stories.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Web server setup apocolpse Linux - Newbie 2 08-14-2005 10:09 AM
fedora 3 Samba Setup Tutorial section31 Fedora 9 05-04-2005 09:44 AM
setup mailserver/web server/ftp server hariiyer Linux - Networking 1 11-27-2004 01:16 AM
Web Server Setup Roach Linux - Networking 2 09-13-2004 08:57 AM
Setup a linux server, DNS, WEB, FTP, and Mail Server Help watermelon_lee Linux - Networking 1 08-26-2003 03:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

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