https://github.com/quartyn/apache-server
Run Apache Server from current working directory
https://github.com/quartyn/apache-server
apache apache-server current-directory
Last synced: 28 days ago
JSON representation
Run Apache Server from current working directory
- Host: GitHub
- URL: https://github.com/quartyn/apache-server
- Owner: Quartyn
- Created: 2025-03-08T20:00:12.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-08T20:10:05.000Z (about 1 year ago)
- Last Synced: 2025-12-27T10:59:56.956Z (5 months ago)
- Topics: apache, apache-server, current-directory
- Language: Shell
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Apache Server from current directory
Moving all files you want to host locally to `/var/www/html` can be really annoying.
This script will allow you to run the apache server from the current working directory.
## How to run a server
Enter the directory you want to host the apache server from.
And then run the command bellow:
```zsh
apache-server
```
## How does it work
When you run the command, new temporary configuration will be created and copied to the apache server configuration.
As soon as you stop the server (Ctrl+C), configuration will be removed, and if there is no other apache host running, the apache service will be automatically stopped. - So you are not always hosting the default directory at `localhost`.
## How to install
Clone this repo to your system.
```zsh
git clone https://github.com/Quartyn/apache-server
```
Enter cloned directory
```zsh
cd apache-server
```
Move the `apacheServerConfig` directory into the `/usr/local/bin` or `/usr/bin` directory (Your choice. I recommend `/usr/local/bin`).
```zsh
sudo mv apacheServerConfig /usr/local/bin
```
After it's done, you will create a new symbolic link to the `apacheServerConfig/run-server` file.
```zsh
sudo ln -s /usr/local/bin/apacheServerConfig/run-server /usr/local/bin/apache-server
```
Optional:
Here, you can also rename the symbolic link `apache-server` with your preferred command name. Then, you will be able to start this command with your "own name".
For example, if you decide your symbolic link to be `run-server`, you will then start the server with command
```zsh
run-server
```
And that's all! Enjoy. Now you can [run a server](#how-to-run-a-server).