Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
int
  • Loading branch information
xdayeh authored Aug 6, 2024
1 parent a1f6bbc commit 5849c4b
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
# setup_server
This Bash script automates the process of setting up a new user, configuring a virtual host in Apache, and creating a basic index.php file in the user's public HTML directory on an Ubuntu system. The script performs the following tasks:

User Creation: Creates a new user with a specified username, home directory, and Bash shell.
Password Setup: Prompts the administrator to set a password for the new user.
Directory Setup: Creates a public_html directory in the user's home directory and sets the appropriate permissions.
Apache Configuration: Copies the default Apache configuration, customizes it for the new virtual host, and enables the site.
Apache Modules and Services: Enables the rewrite module and restarts the Apache service to apply changes.
Hosts File Update: Adds an entry to the /etc/hosts file to map the new domain to 127.0.0.1.
Index.php Creation: Creates a basic index.php file in the user's public_html directory and sets the correct ownership.
# Setup Server

This Bash script automates the process of setting up a new user, configuring a virtual host in Apache, and creating a basic `index.php` file in the user's public HTML directory on an Ubuntu system.

## Features

The script performs the following tasks:

1. **User Creation**: Creates a new user with a specified username, home directory, and Bash shell.
2. **Password Setup**: Prompts the administrator to set a password for the new user.
3. **Directory Setup**: Creates a `public` directory in the user's home directory and sets the appropriate permissions.
4. **Apache Configuration**: Copies the default Apache configuration, customizes it for the new virtual host, and enables the site.
5. **Apache Modules and Services**: Enables the `rewrite` module and restarts the Apache service to apply changes.
6. **Hosts File Update**: Adds an entry to the `/etc/hosts` file to map the new domain to `127.0.0.1`.
7. **Index.php Creation**: Creates a basic `index.php` file in the user's `public` directory and sets the correct ownership.

## Usage

Follow these steps to use the script:

1. Download the script using `curl`:
```bash
curl -O https://raw.githubusercontent.com/xdayeh/setup_server/main/website.sh
2. Make the script executable:
```bash
chmod +x website.sh
3. Run the script with sudo privileges:
```bash
sudo ./website.sh

0 comments on commit 5849c4b

Please sign in to comment.