I’ve been thinking a way to setup my own web and e-mail server as I had a domain and a static IP address for my internet service.
Below is my current configuration:
Step 1 refer “A”
Step 1 refer “B”
“A”
Install Ubuntu 7.10 on your computer then make the host as your domain name: yourdomain.com
Now your network interface needs to change to a static IP, (because we do not use DHCP) also needs to change the host:
192.168.94.10 -----> this will be my server static LAN IP address
127.0.0.1 localhost.localdomain localhost
192.168.94.10 yourdomain.com www
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Now use terminal to run below commands:
hostname
hostname –f
Both should show: yourdomain.com
then we need to update the system so we need to run:
apt-get update
apt-get upgrade
Ok now we have completed the 1st step.
“B”
Next step is installing all the modules: apache, mysql, etc
Installing apache2:
sudo apt-get install apache2
installing php5 for apache2:
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
Restarting apache2:
sudo /etc/init.d/apache2 restart
Now we need to check whether the php working or not, so run:
gksudo gedit /var/www/testphp.php
save ths file with
If that doesn’t work run:
sudo a2enmod php5
sudo /etc/init.d/apache2 force-reload
Now we install MYSQL for apache2:
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
sudo apt-get install phpmyadmin
once this is done you need to edit php.ini file, so run:
sudo gedit /etc/php/apache2/php.ini
uncomment the ";extension=mysql.so" line so that it looks like this
extension=mysql.so
Save the file then exit. then run:
sudo /etc/init.d/apache2 restart
If your phpmyadmin wont work or unable to login run the following,
sudo apt-get install mysql-server
This should fix it.
Ok now we have completed the step 2.
You can access your webserver via: http://192.168.94.10/ or once you complete all the port forwarding you will be access it via: www.yourdomain.com