My HOW-TO: LAMP on CentOS from Source (including Movies)
I am not a professional when it comes to Linux, but I am working in that environment so I had to learn it the hard way and made some notes in the process :)
My "way" isn't necessarily the best, fastest or more secure way. It just works. I thought this might help someone who needs to setup a LAMP Server. LAMP btw. means Linux - Apache - MySQL - PHP So this is a Video-Howto for the installation of a LAMP server based on CentOs ... During the installation you will see I install only the BASE - nothing fancy - no GNOME, nothing, just a base .. You can obviously install things like MySQL etc. as a package during the installation of CentOS - but there is no learning benefit of it and even more important : as a beginner you simply have no idea where it puts all the files which makes it a bit hard when it comes to troubleshooting. The installation of RedHat ES is exactly the same as CentOS is based on it, just 7 days older when it comes to patches etc. In order to use "yum" though - RH ES needs to be activated which obviously cost money - so Simply use CentOS. Get CentOS here. I will also provide the packages I have used to make it easier for you. All packages and video can be found here : http://linux.mike666.co.uk/ I provide the videos in both, uncompressed and rar'ed ... The avis are Microsoft uncompressed as well so you don't need any codecs (or shouldn't really). The way I install Linux is mostly using the TEXT mode. Graphic mode is pretty much the same - but since my server is not next door I need to minimize the bandwidth required since I normally don't fancy a slloooooow mouse etc. So the text mode simply speed things up. Some parts may not needed by you etc., I simply used my notes in order to install it so I will specify whether this is needed or not. Although there is no harm in installing those packages. Over the time we simply needed certain packages so this way its just "complete". So this guide gives you
Here is a screenshot of the quality of the movies http://linux.mike666.co.uk/Sample.JPG This installation assumes there is no other Linux or Windows installation existing - the HDD WILL BE DELETED (and all its partitions) To download the avi files - Right click and "Save as" as it might not play in the browser. |
01. Installation
When you boot up CentOS the first time you will see this splash screen http://linux.mike666.co.uk/splash.JPG In order to use the graphical installation - just hit enter. If you wish to follow my video - type "linux text" and hit enter in order to start the text based installation.
01 - Installation (08:34) - avi 01 - Installation (08:34) - rar |
02. Post Install
After the installation a small configuration tool pops up - which disappears again after a few momemts. Since my server is behind a firewall I disable those security features. As I said before - that doesn't necessarily applies to your environment. But I do it that way so I show how :)
02 - Post Install (03:11) - avi 02 - Post Install (03:11) - rar |
03. Updates
Bringing everything up to date
03 - Updates (06:45) - avi 03 - Updates (06:45) - rar |
04. MySQL Part 1 / Apache Cronolog
MySQL has two parts as I am going to install Perl as well. The installation of DBD / DBI requires a default installation of MySQL - this means a database called "test" has to be there and the root password for the MySQL server should not have a password. I also install the Apache log rotation (Cronolog) in this part. This is actually, as the name says, Apache related. It just happend to be one of my steps I usually do and the movie was done before I actually realised it and I didn't see a point in creating a movie of 10 seconds just for Cronolog.
04 - MySQL Part 1 (06:00) - avi 04 - MySQL Part 1 (06:00) - rar |
|
06. MySQL Part 2
By default MySQL does not allow remote connections. Since I do have a firewall and want to use a 3rd party software to administrate it, this enables remote connections. But this is a security risk and should not be done if you don't have a firewall or if you are not sure.
06 - MySQL Part 2 (01:53) - avi 06 - MySQL Part 2 (01:53) - rar |
07. MySQL Part 3
This is as preparation for the later test. At the end of this tutorial we are creating a PHP Webpage which queries the database and displays the result. This way we test the whole setup - webserver, php and mysql. Basically to do so you have to
You can obviously do the same through the commandline interface (which I am not perfect in) or other software. The other alternative is PHPMyadmin - which is also a good alternative if you don't allow remote connections as this installs directly on the webserver and connects to the database through localhost. As I said - I am not 100% familiar with the commandline interface and I don't like phpmyadmin :) Movie Download 07 - MySQL Part 3 (02:04) - avi 07 - MySQL Part 3 (02:04) - rar |
08. FTP Software Install (VSFTPD)
There are quite a few different FTP software packages out there but I simply prefer vsftpd - it just works.
Movie Download 08 - FTP Server install (01:25) - avi 08 - FTP Server install (01:25) - rar |
09. Libraries and modules
09 - Libraries and modules (03:25) - avi 09 - Libraries and modules (03:25) - rar |
10. Apache Part 1
Movie Download 10 - Apache Part 1 (07:12) - avi 10 - Apache Part 1 (07:12) - rar |
11. PHP Installation
Thats php configuration done now back to apache. Movie Download 11 - PHP (03:09) - avi 11 - PHP (03:09) - rar |
12. Apache Part 2
12 - Apache Part 2 (04:00) - avi 12 - Apache Part 2 (04:00) - rar |
The way Apache is now setup it will always look into
Code:
/usr/local/apache2/conf/v-hosts Remember the MySQL database we have created at the beginning ? Now we build the website for it.
Basically if someone is now browsing to centos-test.domain.com, the server checks all v-host files if it finds the approriate value. It will now find in the v-host file we have just created, that the homefolder for this website is /home/centos-test/htdocs. Now its time to create the website (this point is now covered in the movie also, but not the creation of the v-host file itself). If you now browse to the domain mentioned, you should just see something like "Index of /" as directory browsing is allowed and there are no files in yet.
Browsing now to http://centos-test.domain.com/connection.php should display the content of the table we have created earlier. Obviously I cannot cover EVERYTHING, but this should give you a good overview in how to do it. I also assume at this point that you know for example how to use an editor, such as "vi" or "nano". I also assume that you you know how to setup DNS / IPs and domains etc. as this would really too much to cover here too. But as a quick tip: If you want to test this for example on vmware at home with an IP in your private network, simple give that server a private IP, such as 192.168.1.100 and use this IP in all those v-host files you have created. Now you can even use centos-test.domain.com as URL - HOWEVER, your ADSL provider or / and router obviously doesn't that that this URL should go to your test vm :) In order now to make it work (in Windows), add this URL to your HOST file. In C:\WINDOWS\system32\drivers\etc You will find a file called HOSTS, which looks like Code:
# Copyright (c) 1993-1999 Microsoft Corp. So the full file should look simething like this Code:
# Copyright (c) 1993-1999 Microsoft Corp. So I hope I can help someone with this :) Back to my beer now..... Movie Download 13 - Final Test (01:06) - avi 13 - Final Test (01:06) - rar All packages used to install this testserver and movies can be found here : http://linux.mike666.co.uk/ |
All times are GMT -5. The time now is 01:41 AM. |