-4

Good Afternoon, sorry if its not the right place to ask this question.

I have to make a project, a website, for university, and the client wants to see the progress until the project is finished. The problem is, I don't have that much money to buy a host and searching for some solutions I found that is possible to create a server for free using and old pc. My question is how do I do that same ´server´? And I can also host the database? The website is going to be made using PHP,MySQL,HTML, and some JavaScript.

P.S: I have some knowledge about linux distros, like Ubuntu, so if its necessary use that SO, that's not a problem.

2 Answers2

0

Setting up a server to host a website using an old PC can be a cost-effective way to run a small website or a development/test environment. Here's a general guide to get you started:

Requirements:

Old PC: Ensure that your old PC meets the minimum requirements to run a server, such as having enough RAM, storage, and processing power to handle the expected website traffic. Linux OS: It's recommended to use a lightweight Linux distribution as the operating system. Ubuntu Server, CentOS, or Debian are popular choices. Static IP address: If possible, try to assign a static IP address to your old PC so that the website's address remains consistent. Steps to set up the server:

Install the Operating System:

Download the preferred Linux distribution's ISO file. Create a bootable USB drive or CD/DVD and install the OS on the old PC. Follow the installation prompts and configure the network settings. Install LAMP Stack:

LAMP stands for Linux, Apache, MySQL (or MariaDB), and PHP. This stack will allow you to host dynamic websites. Open a terminal and install the LAMP components using the package manager. For example, on Ubuntu, you can use: lua Copy code sudo apt update sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql Configure Apache:

After installing Apache, you might need to configure virtual hosts to serve your website files correctly. The configuration files are usually located in the /etc/apache2/sites-available/ directory. Create a new virtual host configuration file for your website. For example, create a file named your_website.conf. Define the virtual host settings in the file. Here's a basic example: bash Copy code <VirtualHost *:80> ServerAdmin webmaster@yourwebsite.com ServerName yourwebsite.com DocumentRoot /var/www/html/yourwebsite ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Save the file and enable the virtual host with: Copy code sudo a2ensite your_website.conf sudo service apache2 restart Upload Your Website:

Copy your website files to the appropriate folder defined in the virtual host configuration. In this example, the folder is /var/www/html/yourwebsite. If it's a static website, you can simply copy the files to the specified folder. If it's a dynamic website (using PHP), ensure that PHP is working correctly on your server. Configure MySQL/MariaDB:

If your website requires a database, you'll need to set up MySQL or MariaDB. Follow the prompts during the installation, and make sure to set a secure root password. Create a new database for your website and a dedicated database user with appropriate permissions. DNS Configuration:

Point your domain name to your server's static IP address. You can do this through your domain registrar's control panel. Security Considerations:

Since your server will be exposed to the internet, prioritize security measures. Keep your software up to date, configure a firewall (like UFW), and consider using SSH key-based authentication. Monitor and Maintain:

Regularly monitor your server's performance and logs to ensure everything is running smoothly. Perform backups of your website and databases to avoid data loss. Remember, hosting a website from an old PC may not be as reliable as using a dedicated hosting service. If your website gains significant traffic, you might need to consider upgrading to a more powerful and professional hosting solution. https://bigsaverhub.com/

-1

The two key concepts to research on the internet are Wampserver and Lampserver. The final choice for which "distro" you will use, will depend on the capability of your "old pc" and how complicated it gets.

Both the "Wampserver" and "Lampserver" are a collection of software packages that will include Apache webserver, Mysql database server and PHP. The former runs on Windows and the latter runs on Linux. Also, in the case of the latter, you can search for complete solutions that include not only the Lamp server but the Linux operating system as well.

Any of them can be configured to act as a production server which allows people from outside to view websites on your web server.

If you are reasonably comfortable with Linux, then a very good choice would be Turnkey Linux Lampserver. Download the ISO and create a bootable CD or USB dongle with it (see LiLo). Start your old PC with it and after the installation is complete you will have a Webserver that you can manage with Webmin.

If your old PC already runs Windows, you could download a suitable Wampserver. Good Wampserver distros include Bitnami, Xampp and Wampserver. You will need to match the capability of your PC with the distro. You may need two or three attempts at installing a Wampserver before you find one that suits an "old Pc" - eg 32bit Windows XP.

This information should get you going. You may have more detailed questions in the future.