Publishing System Settings Logout Login Register
Setting up a Linux development server
TutorialCommentsThe AuthorReport Tutorial
Tutorial Avatar
Rating
Add to Favorites
Posted on July 3rd, 2007
7811 views
Unix
Introduction

If you are a developer then you might want to consider seting up a development server with Linux.
Linux is used widely by many hosters today, and so this makes a good choice as a local development server.
For this tutorial you will need a second system to setup as your server.

I have looked at a lot of distrobutions of Linux and I went with CentOS for two reasons. My hoster uses this and it is based on RedHat.
CentOS is also very easy to install and setup.
In this tutorial I am going to take you through all the stages of downloading CentOS, installing and configuring it and get you up and running with your own development server.

Getting CentOS

First of all we are going to need to either download all 6 CD ISO files or the DVD.
Choose your download option from here.

Installing CentOS

Once you have created the DVD place it into your servers dvd drive and either restart or reboot the server.
It should start from the DVD and al the first command prompt press enter. This will start the graphical installer.
This installer is much easier to understand for the new comer to Linux.

When you are asked about partitioning your drives select the top option (delete all partitions) and allow CentOS to claim the complete drive.
If you are showen a partition table next just press enter and allow CentOS to continue.
When confronted with IP address options, leave it at DHCP if you use a router of some kind to connect to the internet. We will change this later as a fixed IP address, this is best for a server.

The next important part is what packages to install.
Make sure you do extra packages and check to configure now in the setup.
Make sure you select as servers ftp, web, samba and MySQL.
I unchecked all office and graphic programs like openoffice and gimp.
If you chose the CD option rather than the DVD, then you will need all 6 ISO files.

Once you have installed CentOS it will reboot and confront you with the post install configuration. This is not hard, just do what it says.


Configuring CentOS

Now when it reboots login as root.

At the top menu select Applications > Add/Remove Software. When the imformation is retrieved, click on the list tab. Now press P and check all your see that starts with php.
Then press M and scroll down untill you see mysql and make sure these are installed, (they will be checked) and if not check them.
mysql
mysql-connector-odbc
mysql-devel
mysql-server
and press apply.

Now remember we left the network configuration at default using a DHCP for your IP. As mentioned above, we will change this now.
On the top menu bar select System > Administration and select network.
It will load up in the devices tab, this is the one you want. So click the edit button and check Statically set IP address.
Now enter the network address as the same as in your range. Like if your router and your computer is 192.168.1.x then enter an IP address in the same range but with a different ending digit that is not in use on your network. For example: If your router is 192.168.1.1 and your computer is 192.168.1.2 then use something like 192.168.1.10. I used 192.168.1.200.
Then enter your Subnet mask, most likely it will be 255.255.255.0.
The Gateway is your routers address.
Then click on DNS and in the primary and secondary DNS enter your ISPs DNS addresses. You can most likely get these from your ISPs home page under support.
For the host name enter 127.0.0.1.
Leave the remaining blank. I entered nothing in those. Now click on the devices tab again and click activate. It will update the config file and then restart your network so you will not have to reboot again.
Now that you have a static address go to your remote system and see if you can ping the IP address you entered for CentOS. If you can then we can carry on.

Now by default Apache is not running, so we will have to start that.

Go to on the top menu Applications > Accessories and click on terminal.
You will need to start apache as by default it will not start at bootup.
Now in the terminal type:
apachectl start
and press enter. This will start apache server for you.

By default all in the /var/www/html (web root) is locked and you do not have access to it.
So lets sort this out.
Click on System > Security Level and Firewall.
Enable the firewall if disabled. Not good to have no firewall.
So once enabled check ftp, ssh and www (html) and then click apply.
You will still not have access to any web files in html so we need to change the group and access rights.
So navigate to var/www and right click on the html folder and select properties.
Change the group to and owner to the use name you entered at post install. You cannot FTP with root.
Change folder access to Create and delete files. Also change others to the same.

Now click "Apply permissions to enclosed files".
Then click close.
So to get mysql, apache and the ftp server to start at boot up do this:

Click on Administration > Server Settings > Services
Now look for and check the following:
Apache = httpd
FTP = vsftpd
MySQL = mysqld
Now close and save the new boot config file.

This is a good point to reboot the server so all servers boot. We want mysql, ftp and the web servers to load and since we have all configured now to start at boot up.
Now on your remote system open a web browser and type in the web address and you should see your test page for apache.
If not try on CentOS server by using http://localhost.
If all is fine on the remote server then we can go to the next stage.
Now if you create a html in the html folder you will be able to access it from the remote system.

Now we need to test FTP from your remote system.
Load up your ftp client and use these connection settings.
server: Your servers IP address.
name: The user name you setup at post install. Remember that linux is case sensitive.
Password: Your user password you entered at post install.
remote location: var/www/html

Now connect. You should connect fine and be able to create files and directories.

I hope this tutorial got you where you expected.
If you have any problems then please do not hesitate in asking questions.
Don't rely on CentOS forums or support. I have found them very poor over the time I have used CentOS

Good Luck!
Dig this tutorial?
Thank the author by sending him a few P2L credits!

Send


This author is too busy writing tutorials instead of writing a personal profile!
View Full Profile Add as Friend Send PM
Pixel2Life Home Advanced Search Search Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Pixel2life Homepage Submit a Tutorial Publish a Tutorial Join our Forums P2L Marketplace Advertise on P2L P2L Website Hosting Help and FAQ Topsites Link Exchange P2L RSS Feeds P2L Sitemap Contact Us Privacy Statement Legal P2L Facebook Fanpage Follow us on Twitter P2L Studios Portal P2L Website Hosting Back to Top