Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 16194  / 2 Years ago, sat, november 5, 2022, 1:06:54

I am working on a database driven website and want to test it using the LAN available to me. How do I host a website? (Static pages will also do)



I tried using php and it works on my system but not on other systems connected on the LAN. I am open to hosting pages via any language.



Note that I don't want to host a website on the internet. I am aware about the Ubuntu server edition, and I am using 12.04 LTS.


More From » networking

 Answers
0

Apache is a good choice for hosting websites over the intranet(LAN) as well as over the internet. Most of the companies use Apache for to host their websites.



Install it using the following command:



sudo apt-get install apache2


And copy your website folder to /var/www.



sudo cp /path/to/website/folder /var/www


Now head over to your browser and open the url http://localhost/websitefolder.
Don't forget to replace websitefolder with the name of your website's folder in /var/www.



To access the website from a different device over the LAN, you need to find out your Local IP address.



Here's how to find it out. Type the following command in the terminal:



ifconfig


Once you know the IP address head over to http://ipaddress/websitefolder using the device's web browser.



Also, regarding the database MySQL and PHP will be an ideal choice for beginning.



Install them using the following commands:



sudo apt-get install php5 libapache2-mod-php5 mysql-server mysql-client


If you want to access the MySQL database using a web interface install phpMyAdmin alongside.



sudo apt-get install phpmyadmin


Don't forget the restart the Apache web server to make everything work perfect.



sudo /etc/init.d/apache2 restart

[#30696] Sunday, November 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oleard

Total Points: 344
Total Questions: 105
Total Answers: 113

Location: Bonaire
Member since Tue, Sep 20, 2022
2 Years ago
;