sh Crea nuovo虚拟主机
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Crea nuovo虚拟主机相关的知识,希望对你有一定的参考价值。
#!/bin/sh
# Crea nuovo virtual host
# Autore: Chialastri Mirko <chialastri.mirko@gmail.com>
# Configuration
VHOST_BASE="/Users/Hiryu/Apps"
APACHE_VHOST_ROOT="/etc/apache2"
# End Configuration
echo "Nome virtual host:"
read -r DOMAIN
HTTPD_CONTENT="`cat <<EOF
<VirtualHost *:80>
DocumentRoot "${VHOST_BASE}/${DOMAIN}"
ServerName ${DOMAIN}
CustomLog /dev/null combined
<IfModule mod_fastcgi.c>
</IfModule>
<Directory "${VHOST_BASE}/${DOMAIN}">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EOF`"
echo $DOMAIN
echo '---'
echo "${HTTPD_CONTENT}"
echo
read -p "Confermi? [Y/y/N/n] " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo
exit 0
fi;
echo
HTTPD_CONF="${VHOST_BASE}/${DOMAIN}/httpd.conf"
# Si assicura che la cartella di destinazione esista
mkdir -p ${VHOST_BASE}/${DOMAIN}
echo $HTTPD_CONTENT > ${HTTPD_CONF}
echo "Creo collegamento simbolico ${HTTPD_CONF} -> ${APACHE_VHOST_ROOT}/sites-enabled/${DOMAIN}"
sudo ln -s ${HTTPD_CONF} ${APACHE_VHOST_ROOT}/sites-enabled/${DOMAIN}
以上是关于sh Crea nuovo虚拟主机的主要内容,如果未能解决你的问题,请参考以下文章
text FB50中的Inserimento nuovo campo(posizioni - 表格控制)
sql Mariadb的Creare nuovo utente con tutti privilegi
sql 每个creare nuovo db con utente associato的片段
Spring thymeleaf在发布请求时出错
Audiokit Midi 多个虚拟端口
使用JSON.NET反序列化json - 无法反序列化,因为类型需要一个JSON数组c#