Browse Source

Remove http and www from sitename

old-stable
Mitesh Shah 12 years ago
parent
commit
0346f4ebbb
  1. 31
      setup/engine

31
setup/engine

@ -354,40 +354,45 @@ then
if [ -n "$3" ] if [ -n "$3" ]
then then
# Remove http:// & www.
Domain=$(echo $3 | sed "s'http://''" | sed "s'www.''")
# Creating Site # Creating Site
echo "Creating $3, please wait..." echo "Creating $Domain, please wait..."
sed "s/example.com/$3/g" ../conf/nginx/basic.conf \ sed "s/example.com/$Domain/g" ../conf/nginx/basic.conf \
> /etc/nginx/sites-available/$3 \ > /etc/nginx/sites-available/$Domain \
|| OwnError "Unable to create configuration file for $3" || OwnError "Unable to create configuration file for $Domain"
# Creating Symbolic Link # Creating Symbolic Link
ln -s /etc/nginx/sites-available/$3 /etc/nginx/sites-enabled/ \ ln -s /etc/nginx/sites-available/$Domain /etc/nginx/sites-enabled/ \
|| OwnError "Unable to create symbolic link for $3" || OwnError "Unable to create symbolic link for $Domain"
# Creating Htdocs & Logs Directory # Creating Htdocs & Logs Directory
mkdir -p /var/www/$3/{htdocs,logs} \ mkdir -p /var/www/$Domain/{htdocs,logs} \
|| OwnError "Unable to create htdocs and logs directory" || OwnError "Unable to create htdocs and logs directory"
# Creating Symbolic Links For Logs # Creating Symbolic Links For Logs
ln -s /var/log/nginx/$3.{accss.log,error.log} /var/www/$3/logs/ \ ln -s /var/log/nginx/$Domain.{accss.log,error.log} /var/www/$Domain/logs/ \
|| OwnError "Unable to create symbolic link for $3 logs" || OwnError "Unable to create symbolic link for $Domain logs"
if [ "$4" = "--with-wordpress" ] if [ "$4" = "--with-wordpress" ]
then then
# Download Latest Wordpress # Download Latest Wordpress
wget -cO /var/www/$3/htdocs/latest.tar.gz \ wget -cO /var/www/$Domain/htdocs/latest.tar.gz \
http://wordpress.org/latest.tar.gz http://wordpress.org/latest.tar.gz
# Extracting Wordpress # Extracting Wordpress
tar --strip-components=1 -zxf /var/www/$3/htdocs/latest.tar.gz \ tar --strip-components=1 -zxf /var/www/$Domain/htdocs/latest.tar.gz \
-C /var/www/$3/htdocs/ -C /var/www/$Domain/htdocs/
# Removing Wordpress Archive # Removing Wordpress Archive
rm /var/www/$3/htdocs/latest.tar.gz rm /var/www/$Domain/htdocs/latest.tar.gz
# Modify wp-config.php # Modify wp-config.php
# Change Ownership
chown -R www-data:www-data /var/www/$Domain/
fi fi

Loading…
Cancel
Save