Wednesday, March 7, 2012

Internal Server Error - .htaccess ubuntu

need to enable rewrite mod

root@ssnew:/# a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!
root@ssnew:/# /etc/init.d/apache2 restart
* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]

ubuntu install ghostscript jpgraph

root@ssnew:/home/cmmolc# apt-get install ghostscript

root@ssnew:/home/cmmolc# apt-get install libphp-jpgraph

disable root login via ssh - ubuntu

Change "PermitRootLogin yes" to "PermitRootLogin no"

root@li78:~# vim /etc/ssh/sshd_config

PermitRootLogin no

ubuntu 10 login warning banner

1, open file
root@li98:~# vim /etc/ssh/sshd_config
uncomment
Banner /etc/issue.net

2, Add your warnig to /etc/issue.net

3, restart ssh service
root@li78:~# service ssh restart

Tuesday, March 6, 2012

VirtualHosts not working - ubuntu

1, default file:

root@l78:/etc/apache2# less sites-available/default
NameVirtualHost 7.27.22.7:80

ServerAdmin gxxxng@gmail.com

DocumentRoot /var/www


Options FollowSymLinks
AllowOverride None


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all


ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined


2, your website
root@li94-78:/etc/apache2# less sites-available/3wtemplates.com


ServerAdmin gxxxxxxxxx@gmail.com

ServerName 3wtemplates.com
ServerAlias www.3wtemplates.com

DocumentRoot /var/www/3wtemplates.com/htdocs

NameVirtualHost *:80 has no VirtualHosts - ubuntu

comment out this line in

root@l948:/etc/apache2# vim ports.conf
#NameVirtualHost *:80

Friday, March 2, 2012

linux date command fields without zeros

With zero
root@li60:~/security# date --date "1 day ago" "+%b %d"
Mar 01

Without zero
root@li60:~/security# date --date "1 day ago" "+%b %-d"
Mar 1