Documentation

Installation

Composer command

composer create-project dhruvjoshi/precocious

Create Linux Server and Auto-installer - Apache | Nginx


Finalizing Installation

The script will perform the necessary installations and configurations. Once it finishes, you will see a completion message.

sudo curl -O https://raw.githubusercontent.com/DevDhruvJoshi/PrecociousServerConfiguration/main/setup.sh && sudo chmod +x setup.sh && sudo ./setup.sh


Run MySQL Secure Installation: After the setup, you will need to run the command mysql_secure_installation manually to secure your MySQL installation.

Expected Output

You will see messages indicating the progress of the installation, including updates, package installations, and configuration steps. Any errors will be displayed in red for easy identification.

Post-Installation

Notes

Troubleshooting

If you encounter issues, check the Apache logs located at /var/log/apache2/error.log for errors. Ensure that your server is updated and that all necessary packages are available.

Conclusion

This script simplifies the process of setting up a web server environment. By following this documentation, users can quickly get their server ready for web hosting with the required software stack.




Enabling mod_rewrite module

mod_rewrite is an Apache module that allows you to rewrite URLs and create custom rules for your website. This can be very useful for SEO and improving user experience.

Here's a guide on enabling mod_rewrite for different operating systems:

Windows (XAMPP):

#LoadModule rewrite_module modules/mod_rewrite.so

Linux:

sudo systemctl restart apache2

Mac:

sudo apachectl restart

Additional Tips:


Virtual Host

1. Editing the Hosts File

Before configuring the virtual host, you need to modify the hosts file to map a custom domain name to your local machine's IP address (usually 127.0.0.1).

Note: You'll likely need administrator privileges to edit this file. Use a text editor like Notepad++ (Windows) or TextEdit (Mac) with administrator rights.

Add the following line to the hosts file, replacing precocious.dev with your desired domain name:

127.0.0.1 precocious.dev


2. Configuring the Virtual Host

The location of the virtual host configuration file depends on your operating system and web server software. Here's a breakdown for common setups:

A. Apache (Windows/Linux/Mac):

The virtual host configuration file is typically located in:

Create a new virtual host configuration file with a descriptive name (e.g., precocious.conf).

Add the following code to the virtual host file, replacing placeholders with your project details:

Apache

<VirtualHost *:80>

  ServerName precocious.dev

  DocumentRoot /path/to/your/precocious/project

  <Directory /path/to/your/precocious/project>

    Options Indexes FollowSymLinks

    AllowOverride All

    Require all granted

  </Directory>

</VirtualHost>


Use code with caution.

Replace the following placeholders:

3. Enabling the Virtual Host

A. Apache (Windows/Linux/Mac):

4. Testing Your Virtual Host

Once you've completed the steps above, you should be able to access your precocious project using the domain name you specified in the hosts file (e.g., [invalid URL removed]).