Web Development

Adding your test web page on the server

The var directory in Linux filesystem

It is the default directory where the files to be shared are stored. This is a common folder for all the servers such as FTP server, Apache server etc. Each server has a subdirectory in the var folder Apache has the subdirectory www by default.

Create a test web page by using html. Suppose the name of the file which you made is stored is index.htm

If you want to deploy this web page by using Apache server. type the comment

cd /var/www

copy the file for your web page in this folder by using cp command.

Open the bowser in the Linux system and type the static or the dynamic ip address of your system.

To deploy your web page using nginx server.

Stop the apache server because the both use the same port for communication i.e. port number 80

restart the nginx server by the command

sudo service nginx restart

find the default location to store the files by typing the command

vim /etc/nginx/sites-available/default

the default location is written next to the "root:" tag in the file. Save your data at this location. Restart the nginx service.

Open the browser and type the static or dynamic address. You can view your web page.