SVPS - Auto Mount VPS
Install
npm i svps
Initializing the Environment
npx svps || npx svps init
-
This will create the default configuration files:
['.svpsrc.js', '.domains.json', '.cronjobs.sh', 'index.html'];
-
Edit
.svpsrc.js
with the SSH access and your settings
Mounting VPS
npx svps mount
Setps:
- Fixes common conflicts on Ubuntu
- Runs common apt commands
- Sets the most common Firewall settings
- Installs Apache2 and forbids access to the default
html
directory - Installs vsftpd with users setted in
.svpsrc.js
- Prepares the Virtual Host and abilite Rewrite
- Installs PHP with the version setted in
.svpsrc.js
- Installs Node.js with the version and global modules setted in
.svpsrc.js
- Installs MySQL and creates the databases and users setted in
.svpsrc.js
- Adds cronjobs setted on the file specified in
.svpsrc.js
- Reruns common apt commands
- Executes your personal sh commands specified in
.svpsrc.js
- Restart VPS
Notes:
-
All steps are optional: You can enable or disable any step in
.svpsrc.js
- You are free to disable all the steps and create your own module of sh commands Λ£βΏΛ£
- See
APPEND_COMMANDS
in.svpsrc.js
- See
- The entire remote process is displayed on console in real time
- This may take a long time depending on your VPS plan
Adding Virutal Hosts
npx svps set domains
- Gets listed domains in
.domains.json
- Sets the Virtual Host for each domain and
www
CNAME - Creates each domain directories with a default
index.(html|php)
setted in.svpsrc.js
- The domains previously set up or repeated in the list will be ignored
For Node.js:
-
The proxy is already auto-configured to route all local ports to 80, then just add the domains with local port in
.domains.json
:[ ..., "mysite.com:3000", // π mysite.com/app.js // π mysite.com/public_html/index.html "mycname.mysite.com:3001", // π mycname.mysite.com/app.js // π mycname.mysite.com/public_html/index.html "myothersite.com:3002", // π myothersite.com/app.js // π myothersite.com/public_html/index.html ]
- Don't repeat local ports!
For PHP:
-
Just add the domains in
.domains.json
:[ ..., "mysite.com", // π mysite.com/public_html/index.html "mycname.mysite.com", // π mycname.mysite.com/public_html/index.html "myothersite.com", // π myothersite.com/public_html/index.html ]
Notes:
- Both PHP and NodeJS can work together
π¨βπ¨βπ§βπ¦ - All automatically generated files are disposable
Important
- This package is designed for pre-built VPS (Ubuntu
>=18.04
) - The VPS user needs to be the root or a super user
- Don't run this package on a VPS that is already in production
β
Compatibility
License
Credits
Contributors | GitHub |
---|---|
Author |