Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Apr 24, 2012 6:22 pm 
Offline
Junior Member

Joined: Sun Mar 21, 2010 11:19 pm
Posts: 45
Just wondering if anyone can recommend a lightweight command line script for managing Apache on Ubuntu boxes? Bonus would be for deploying WordPress installations :P


Top
   
PostPosted: Tue Aug 07, 2012 8:53 pm 
Offline
Senior Newbie
User avatar

Joined: Mon Jul 23, 2012 1:39 pm
Posts: 11
Website: http://doloresportalatin.info
WLM: meskarune@hotmail.com
Yahoo Messenger: meskarune
AOL: meskarune
Location: USA
This is the only one I know of off the top of my head:

https://github.com/coto/server-easy-install#readme

You could probably edit it for php and wordpress. I'm sure there are more out there.

_________________
If you haven't heard this:

echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc

You aren't using your computer enough.


Top
   
PostPosted: Sat Sep 01, 2012 11:14 am 
Offline

Joined: Mon Jul 30, 2012 7:04 pm
Posts: 1
I use a script from http://commandlineidiot.com which I have modified to fit my needs. It just adds domains, but I have been meaning to add a function to remove domains.

Code:
#! /bin/bash 
#
# =======================
# Siteup Script 0.5
# Written by Command Line Idiot
# http://commandlineidiot.com
# You may use, modify, and redistribute this script freely
# Released: August 2007
# Modified by Josh Price
# Re-Release: July 2012
# =======================

# =======================
# Root check
# =======================
# init
FILE="/tmp/out.$$"
GREP="/bin/grep"

if [ "$(id -u)" != "0" ]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi
# End Root Check


# =======================
#   set functions
# =======================
#   make_index is the function to create a basic index.html file
#    within the documents directory of the new domain. The variable
#    for domain name is passed into the file at $dname. You can alter
#   any of the code between the terms _EOF_ and it will be reflected
#   in the index.html file.
function make_index
{
cat <<- _EOF_
   <html>
   <head><title>$dname</title></head>
   <body>$dname Coming Soon.</body>
   </html>
_EOF_
}
# =======================
# End make_index
# =======================

#   make_vhost is the function to create a config file that
#   Apache2 can interpret. The variable for the domain name is passed
#   into the file at $dname, and the system-wide variable for username
#   is passed into the file at $USER. You may wish to replace the
#   ServerAdmin email address with your own email address. You may alter
#   any of the code between the terms _EOF_ to build your own preferred
#   standard config file. 

function make_vhost
{
cat <<- _EOF_
   <VirtualHost *:80>
      # Admin email, Server Name (domain name), and any aliases
      ServerAdmin support@$dname
      ServerName  www.$dname
      ServerAlias $dname

       # Index file and Document Root (where the public files are located)
        DirectoryIndex index.html index.php
        DocumentRoot /home/USERNAME/sites/$dname/public_html

        # Log file locations
        LogLevel warn
        ErrorLog  /home/USERNAME/sites/$dname/log/error.log
        CustomLog /home/USERNAME/sites/$dname/log/access.log combined
</VirtualHost>
_EOF_
}

# =======================
#        header
# =======================
clear 
echo "***      Site Setup      ***"
 
# =======================
# set domain name variable
# =======================
echo -n "==> Enter new domain name (domain.com): "
read dname
echo "Setting up files for $dname"

# =======================
# create needed directories
# =======================
mkdir -vp /home/USERNAME/sites/$dname
mkdir -vp /home/USERNAME/sites/$dname/log
mkdir -vp /home/USERNAME/sites/$dname/public_html
touch /home/USERNAME/sites/$dname/log/access.log
echo "created /home/USERNAME/sites/$dname/log/access.log"
touch /home/USERNAME/sites/$dname/log/error.log
echo "created /home/USERNAME/sites/$dname/log/error.log"

# =======================
# build index file
# =======================
make_index > /home/USERNAME/sites/$dname/public_html/index.php
echo "created /home/USERNAME/sites/$dname/public_html/index.php"

# =======================
# build vhost config file
# =======================
make_vhost > /etc/apache2/sites-available/$dname
echo "created /etc/apache2/sites-available/$dname"

# =======================
# Add site to Apache
# =======================
a2ensite $dname

# =======================
# Restart Apache
# =======================
/etc/init.d/apache2 reload

# =======================
#    exit
# =======================

echo "***      Finished setting up files for $dname. Goodbye!"
exit


Edit as you need. Replace USERNAME with your username.


You could easily add wordpress installation to this


Top
   
PostPosted: Sun Apr 14, 2013 9:42 pm 
Offline
Junior Member

Joined: Sun Mar 21, 2010 11:19 pm
Posts: 45
I'd like to bump this as it's been a while. Still haven't found anything that really fits a need.

Looking for a CLI script for NGINX, installing WordPress is a bonus.

Curious what others might be using. Thanks!


Top
   
PostPosted: Mon Apr 15, 2013 2:39 am 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
You know how to make it manually right? Why not adjust the script yourself to fit your purposes. Just read it, it really isn't that hard :)


Top
   
PostPosted: Mon Apr 15, 2013 4:23 am 
Offline
Senior Member
User avatar

Joined: Wed Mar 17, 2004 4:11 pm
Posts: 554
Website: http://www.unixtastic.com
Location: Europe
mattm wrote:
I'd like to bump this as it's been a while. Still haven't found anything that really fits a need.

Looking for a CLI script for NGINX, installing WordPress is a bonus.

Curious what others might be using. Thanks!


I use vi.

Well you did ask.


Top
   
PostPosted: Mon Apr 15, 2013 8:15 am 
Offline
Junior Member

Joined: Sun Mar 21, 2010 11:19 pm
Posts: 45
It's really to give to a support type person, so they can create the domain(s) without me having to worry about them having direct access. Thanks anyway! ;)


Top
   
PostPosted: Mon Apr 15, 2013 10:44 am 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
Well, different users want different things. I have a script I use for nginx that creates a user and SFTP chroots them on Debian. It creates public_html/tmp/logs directories and sets up a PHP-FPM pool for them. It doesn't install Wordpress. I could pass along that one for you, but I can't guarantee it'll work for you, plus you may have a different configuration SFTP / PHP-FPM wise.


Top
   
PostPosted: Sun Jun 30, 2013 2:18 am 
Offline

Joined: Sun Jun 30, 2013 2:11 am
Posts: 1
Nuvini wrote:
Well, different users want different things. I have a script I use for nginx that creates a user and SFTP chroots them on Debian. It creates public_html/tmp/logs directories and sets up a PHP-FPM pool for them. It doesn't install Wordpress. I could pass along that one for you, but I can't guarantee it'll work for you, plus you may have a different configuration SFTP / PHP-FPM wise.


I have nginx and I am looking for a script to manage it.
It would be a kindness if you were to share it here on the forum...

_________________
Free hosting


Last edited by snippet on Sun Sep 22, 2013 6:15 am, edited 1 time in total.

Top
   
PostPosted: Sun Jun 30, 2013 6:05 am 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
snippet wrote:
Nuvini wrote:
Well, different users want different things. I have a script I use for nginx that creates a user and SFTP chroots them on Debian. It creates public_html/tmp/logs directories and sets up a PHP-FPM pool for them. It doesn't install Wordpress. I could pass along that one for you, but I can't guarantee it'll work for you, plus you may have a different configuration SFTP / PHP-FPM wise.


I have nginx and I am looking for a script to manage it.
It would be a kindness if you were to share it here on the forum...

Here you go:
http://pastebin.com/vcbVacGB
Remember though - it's specifically for my own purposes so it might not fit what you're looking for :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group