A tool for batch creation of web sites.
This set of scripts creates a number of user accounts, virtual hosts and mysql users and databases.
The websitesmk.sh
script creates :
- a user
- a home directory
- a database user
- a database
- a dedicated Apache2 virtual host
- a dedicated PHP FPM pool
All names have the following common base : websiteXX
where XX is an integer from 1 to 30 :
- the users are
websiteXX
- the home directories are
/home/websiteXX
- the databases users are
websiteXX
- the databases are
websiteXX
- the dedicated Apache2 virtual hosts are if the form
websiteXX.example.com
- the dedicated PHP FPM pools are
websiteXX
- Linux system
- Apache 2.4
- MariaDB 15.x
- PHP 8.x FPM
Copy websitesconf.sh.dist
as websitesconf.sh
and choose appropriate values.
Edit websitesconf.sh
and change the value of domain_name
to choose the domain name of the sites you want to create.
Edit websitesconf.sh
and change the value of websites_count
to choose the number of sites you want to create.
Edit websitesconf.sh
and change the value of user_base_passwd
and mysql_passwd_base
to choose the password base for the user account and the mysql user.
The template-vhost.conf
is a template file for Apache2 vhost.
The {username}
keyword is replaced with a value generated by the websitesmk.sh
script.
The 000-default.conf
is the default virtual host file shipped with Apache2.
It is not used by the project but is a good starting point.
The template-pool.conf
is a template file for PHP FPM pool.
The {username}
keyword is replaced with a value generated by the websitesmk.sh
script.
The www.conf
is the default pool file shipped with PHP FPM.
It is not used by the project but is a good starting point.
The template-index.html
is a template file for HTML index page.
The {username}
keyword is replaced with a value generated by the websitesmk.sh
script.
The template-test.php
is a template file for PHP test page.
The {username}
keyword is not used.
To create web sites:
sudo ./websitesmk.sh
sudo ./websitespwd.sh
To change passwords:
sudo ./websitespwd.sh
To remove web sites;
sudo ./websitesrm.sh
When using the Quickconnect feature, do not forget to specify the network protocol in the Host field.
This is necessary if the ssh port is not the default one (ie not 22
).
Example:
- Host:
sftp://123.123.123.123
- Port:
54321