Category: Web Server

Linux ftp server – installation, setup and configuration

By peter, September 12, 2009

Installing ftp (vsftpd)


1. Install “vsftpd”
2. Once installed go to the:
1. “/etc/xinetd.d/vsftpd” file and change the “disabled” value to “no”.
3. Vi the “/etc/vsftpd.conf” file and uncomment the line “Listen = NO”. Make sure the option is set to “NO”
4. Now restart the “xinetd” (”rcxinetd restart” for SuSE or “service xinetd restart” other distros like Redhat)
5. Vi the file “etc/ftpusers” and add in any user you don’t want to access your ftp site. By default “root” is included in this file.

Test your ftp access by typing “ftp 192.168.0.1″ or whatever the IP address is, in the shell. If it is working you will be asked for a username and password. you can log on as anonymous.

Setting up Virtual hosts – Apache web server

By peter, August 19, 2009

You can host more that one website on a server by using virtual hosts. These web sites all share the same IP address.


Suppose you wanted a website called peter.co.za and a website called dna.co.za to run off the same web server on the same port (80)

1. Create two folders under the directory “/srv/www/” one called “peter” and the other called “dna” copy an index.html page to each folder.

2. make sure the file and folder permissions are correct on each, for example:

chown wwwrun /srv/www/dna

chown wwwrun /srv/www/dna/index.html

3. now browse to the folder “/etc/apache2/vhosts.d/” folder and copy the template found there and paste it as peter.conf and dna.conf. s shown below

cp  vhost.template  peter.conf


4. vi each file and change the following:

<VirtualHost peter.co.za:80>

ServerName peter.co.za

DocumentRoot /srv/www/peter

ErrorLog /var/log/apache2/peter.co.za-error_log

CustomLog /var/log/apache2/peter.co.za-access_log combined

UseCanonicalName On

ScriptAlias /cgi-bin/ “/srv/www/cgi-bin”

<Directory “/srv/www/cgi-bin”>

AllowOverride None

Options +ExecCGI –Includes

Order allow,deny

Allow from all

</Directory>

<Directory “/srv/www/peter/”>

AllowOverride None

Options Indexes FollowSymLinks

Order allow,deny

Allow from all

</Directory>

5. Now do the same for the other Virtual hosts

Virtual Hosts with Apache web server

Virtual Hosts with Apache web server

6. Next browse to the folder “/etc/apache2/” and edit the file “listen.conf” and add the following line for each of your virtual hosts. In this example I have added the line for the two sites peter.co.za and dna.co.za

7. You can now test your config by typing the following at the command prompt

apache2ctl configtest

8. Reload Apache by typing “apache2 restart” at the command prompt

9. Test by browsing to http://peter.co.za and http://dna.co.za

TIP

For testing Virtual hosts you will need to create host name to ip address mapping in your host file. The host file is found in the “/etc” folder

Installation, setup and configuration of Linux Apache2 web server

By peter, August 19, 2009

Getting Apache started


Apache is the Linux web server. Make sure you install apache2 from the installation CD. You can also download it from the Internet.

Getting Apache running

Start the apache at the command prompt by typing the command

rcapache2 start.

To make sure that it starts at boot type the command

chkconfig apache2 on

If you have installed the demo web pages you will get a web page to confirm that it works.

Configuring Apache

With SuSE web pages are stored in the /srv/www/htdocs/ folder. Other distros could store default web pages in other locations (In older versions, web pages were stored in the following directory /usr/local/httpd/htdocs/)
Copy your own web site to this location (by default the home page is index.html) If you want to use another name you need to do the following:

edit the /etc/apache2/httpd.conf file

edit the /etc/apache2/httpd.conf file




vi the file etc/apache2/httpd.conf and Find the line “DirectoryIndex index.html” Add to the same line after “index.html” any other page name you want to use. (Apache searches in the order of the page names you specify and servers the first one it comes across)

OfficeFolders theme by Themocracy