


How to install Apache 2, PHP 5 & MySQL 5 in one go.
Today I will show you how to get a web server up and running in no time on Ubuntu Linux including extra packages that most professional web host companies would have enabled.
You will be hosting websites in no time!
NOTE: Please read this page as a reference before continuing on. As it may help, some references might relate to Ubuntu Linux.
Package Descriptions:
Lets get started on installing, In console:
sudo apt-get install apache2 php5 mysql-server php5-mysql
You can now just copy over your website to the location "/var/www/" and enter http://localhost/ into your browser to see your website. To internet, your URL would be http://youripnumber/ if you wanted to show someone.
You are done at this point for the basic web server unless!
>You want to serve your web site contents out of another location in your file sytsem.
>If you want the extra packages that professional webhosting companies would have installed.
Then continue reading!
Serving content out of another directory:
Now onto the editing the default configuration file, "/etc/apache2/sites-enabled/000-default":
sudo nano /etc/apache2/sites-enabled/000-default
First, 4 lines of the default configuration file, you will see "DocumentROOT /var/www/":
DocumentROOT /var/www/
Change that location to where your web site files are are located.
Restarting Apache 2 to take effect:
sudo /etc/init.d/apache2 restart
How to install extra packages section!
Time to install them:
sudo apt-get php5-gd php5-imagick php5-mcrypt phpmyadmin
Restart apache 2 afterwards for the packages to take effect:
sudo /etc/init.d/apache2 restart
Note: To use phpmyadmin, open your web browser to http://localhost/phpmyadmin
Enjoy your web server :)
Comments
Repository
zypper in php5-gd php5-imagick php5-mcrypt phpmyadmin Refreshing 'Packman Repository' * Cleaning repository 'Packman Repository' cache * Building repository 'Packman Repository' cache Refreshing 'SuSE_Repository' * Reading repository 'updates' cache * Reading repository 'ATI Repository' cache * Reading repository 'Packman Repository' cache * Reading repository 'Main Repository (NON-OSS)' cache * Reading repository 'multimedia-audio' cache * Reading repository 'Main Repository (OSS)' cache * Reading repository 'VideoLan Repository' cache * Reading repository 'SuSE_Repository' cache * Reading installed packages [100%] skipping package 'php5-gd' (already installed) package 'php5-imagick' not found skipping package 'php5-mcrypt' (already installed) package 'phpmyadmin' not found Nothing to do.From memory the universal
Post new comment