-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
int
- Loading branch information
Showing
1 changed file
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |