133 | | |
134 | | |
| 134 | === Postgresql Instance Details for CI Server === |
| 135 | |
| 136 | '''Database name''': sahana |
| 137 | |
| 138 | '''Database user''': kunal |
| 139 | |
| 140 | '''Database user password''': eden |
| 141 | |
| 142 | '''Host''': localhost |
| 143 | |
| 144 | '''Port''': 5432 |
| 145 | |
| 146 | |
| 147 | ==== How to Connect to Sahana Database from the console ==== |
| 148 | {{{#!sh |
| 149 | psql -d sahana -U kunal |
| 150 | }}} |
| 151 | |
| 152 | ==== How to Restart Postgresql Server (You can give it a shot, if psql fails to connect) ==== |
| 153 | {{{#!sh |
| 154 | sudo su - postgres |
| 155 | /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & |
| 156 | }}} |
| 157 | |
| 158 | === Other Useful Linux command sets === |
| 159 | |
| 160 | * '''Pre-populate database (any type of db)''' : |
| 161 | {{{#!sh |
| 162 | cd ~web2py |
| 163 | sudo python web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py |
| 164 | }}} |
| 165 | * '''chmod directory recursively (chmod everything inside dir with -R):''' |
| 166 | {{{#!sh |
| 167 | chmod -R 777 /home/web2py |
| 168 | }}} |
| 169 | * '''start web2py''' |
| 170 | {{{#!sh |
| 171 | cd ~web2py |
| 172 | python web2py.py -a root |
| 173 | }}} |
| 174 | * '''reboot server''' |
| 175 | {{{#!sh |
| 176 | sudo /sbin/reboot |
| 177 | }}} |
| 178 | * '''Restart Cherokee''' |
| 179 | {{{#!sh |
| 180 | sudo /etc/init.d/cherokee restart |
| 181 | }}} |
| 182 | * '''Restart Web2Py SSL''' |
| 183 | {{{#!sh |
| 184 | sudo /etc/init.d/uwsgi start |
| 185 | }}} |
| 186 | * '''Recreate Sahana DB''' : |
| 187 | {{{#!sh |
| 188 | psql -U postgres -c "drop database sahana" |
| 189 | psql -U postgres -c "create database sahana" |
| 190 | psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE sahana to kunal" #Assuming kunal is the name of the postgresql username which will be used by Sahana Eden instance |
| 191 | psql -d sahana -U kunal |
| 192 | }}} |
| 193 | * '''Setup Cron''' : |
| 194 | {{{#!sh |
| 195 | crontab -e |
| 196 | }}} |
| 197 | '''Note''' : You can refer to examples of crontab expressions here : http://code.google.com/p/ncrontab/wiki/CrontabExamples |
| 198 | * '''start Window based applications (x11)''': |
| 199 | * If the GUI window of the application is of no intrest to you |
| 200 | {{{#!sh |
| 201 | xvfb-run -a *test commands here* |
| 202 | }}} |
| 203 | For example : |
| 204 | {{{#!sh |
| 205 | xvfb-run -a python web2py.py -S eden -M -R applications/eden/modules/tests/suite.py -A -V 2 |
| 206 | }}} |
| 207 | '''Note''': Xvfb basically makes a virtual display which isn't displayed anywhere. Xserver itself actually requires a real display |
| 208 | * If you want to see the GUI interface of the application |
| 209 | * If your machine you use to ssh into the server, has X Server installed, then you can access the GUI window by using the -X flag when loggin into the server |
| 210 | {{{#!sh |
| 211 | ssh -X youraccount@82.71.213.53 |
| 212 | }}} |
| 213 | And now, if you simply execute any application which has a Xserver attached to it, it will be displayed on your screen. |