WebFaction Software installation


http://docs.webfaction.com/software/java.html

http://community.webfaction.com/questions/4116/install-tomcat-howto-or-step-by-step-tutorial

Here's how you can install Tomcat:

  1. Go to Apps in the control panel and create a new 'custom app listening on port' application. Make a note of the port number assigned to the app. You can name the app whatever you want – in this example, let's name it 'tomcat'.

  2. Go to Sites in the control panel and create a site to serve the app you created in step 1.

  3. SSH into your server and run the following commands:

    1. cd ~
    2. echo "export JRE_HOME=/usr/lib/jvm/jre-1.6.0-openjdk" >> ~/.bashrc
    3. source ~/.bashrc
    4. wget http://apache.mirrors.pair.com/tomcat/tomcat-7/v7.0.16/bin/apache-tomcat-7.0.16.tar.gz
    5. cd ~/webapps/tomcat
    6. tar zxf ~/apache-tomcat-7.0.16.tar.gz –strip 1
  4. Edit ~/webapps/tomcat/conf/server.xml to change connector port 8080 to the port assigned to your custom app.

You can then start Tomcat by running:

~/webapps/tomcat/bin/startup.sh

Once Tomcat is running, you should see the "If you're seeing this, you've successfully installed Tomcat. Congratulations!" page when you visit the site you created in step 2.

You can stop it by running:

~/webapps/tomcat/bin/shutdown.sh

http://www.webfaction.com/screencasts/trac-svn/trac-svn-screencast.html

Create a list of users via script

This has not been tested yet.

#!/usr/bin/ksh

NEW_USERS="/path/to/text_data_file"
HOME_BASE="/home/"

cat ${NEW_USERS} | \
while read USER PASSWORD GROUP
do
useradd -g ${GROUP} -p ${PASSWORD} -m -d ${HOME_BASE}${USER} ${USER}

#echo "$pass" | useradd -p "$name"
echo "$PASSWORD" | smbpasswd -as "$USER"

(echo $PASSWORD; echo $PASSWORD)| smbpasswd -s -a $USER_NAME)


done

To remove the ^M characters at the end of all lines in vi

In UNIX, you can escape a control character by preceeding it with a CONTROL-V. The :%s is a basic search and replace command in vi. It tells vi to replace

:%s/^V^M//g

The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like this:

:%s/^M//g

FIND

Any file in unix that starts with a ".", like .profile, is a hidden file. That's how that works

to include these files in your find:

ls -a

find txt in file
$ find . -name "*.log" -exec grep -l "addQuickDepositAccounts" {} \;

find file by name
$ find . -name "rc.conf" -print

$ find . -name "event*.jar"

Fine a filename that contains properties

$ find . -print | grep properties

Find a string in all directories for a string.

$ find . -exec grep "string" {} /dev/null \;

TAR command


extract a tar file to current dir
tar -xvwf myfile.tar


create a tar file to current dir
tar -cvwf file.tar myfile.txt

tar -zxvf yourfile.tar to extract the file to the current directory.

tar -C /myfolder -zxvf yourfile.tar to extract to /myfolder directory.


Tag Cloud