#!/bin/bash
useradd $1
mkdir /home/$1
mkdir /home/$1/$1.$2
mkdir /home/$1/logs
chown $1:$1 /home/$1 -R *
passwd $1
passwd -u $1
usermod -s /bin/bash $1
usermod -a -G $1 www-data
chmod 750 /home/$1
echo "<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName $1.$2
ServerAlias www.$1.$2
DocumentRoot /home/$1/$1.$2
ErrorLog /home/$1/logs/error.log
CustomLog /home/$1/logs/access.log combined
<IfModule mod_fastcgi.c>
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi-$1.$2
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi-$1.$2 -socket /var/run/php5-fpm-$1.$2.sock -idle-timeout 300 -pass-header Authorization
</IfModule>
</VirtualHost>
<Directory /home/$1/$1.$2/>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
" > /etc/apache2/sites-available/$1.$2.conf
echo "[$1.$2]
user = $1
group = $1
listen = /var/run/php5-fpm-$1.$2.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 20
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 20
chdir = /" > /etc/php5/fpm/pool.d/$1.$2.conf
a2ensite $1.$2.conf
systemctl restart php5-fpm.service
service apache2 restart
echo 127.0.0.1 $1.$2 >> /etc/hosts
Ajánlott cikkek még...
-
Szerverek telepítési howto-khttps://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-lamp-on-debian-jessie/ https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-16-04-lamp/ https://www.linode.com/docs/web-servers/apache/install-php-fpm-and-apache-on-debian-8 https://github.com/Froxlor/Froxlor/wiki/apache2-with-fcgid https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension
SSD cache linux rendszerenKépzeld el - van egy méretes HDD-d, melyen adatbázist tárolsz, torrentezel, vagy oprendszert futtatsz. Végülis…
php7 szerver telepítés debian 9-enapt-get -y install curl mysql-server mysql-client mariadb-server mariadb-client apache2 php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-gd php7.0-intl…
-