Monthly Archives: June 2013

#apache #httpd namevirtualhost, virtualhost and servername

OSDE.INFO

in #apache #httpd to setup virtual hosts use tyhe directives namevirtualhost, virtualhost and servername

NameVirtualHost *:80

<VirtualHost *:80>
 ServerName site1.example.com
 DocumentRoot /var/www/site1/public_html
 <Directory "/var/www/site1/public_html">
  allow from all
  Options +Indexes
 </Directory>
</VirtualHost>

<VirtualHost *:80>
 ServerName site2.example.com
 DocumentRoot "/var/www/site2/public_html"
 <Directory "/var/www/site2/public_html">
  allow from all
  Options +Indexes
 </Directory>
</VirtualHost>

<VirtualHost *:80>
 ServerName site3.example.com
 DocumentRoot /var/www/site3/public_html
 <Directory "/var/www/site3/public_html">
  allow from all
  Options +Indexes
 </Directory>
</VirtualHost>

to get a list of your vhosts type

httpd -S

see also

View original post

#php ini file #date & #timezone settings

dont forget to edit your php.ini file and add a prefered date timezone to prevent apache httpd php warnings such as:

PHP Warning:  date(): It is not safe to rely on the system's timezone 
settings. You are *required* to use the date.timezone setting or 
the date_default_timezone_set() function. 

In case you used any of those methods and you are still getting 
this warning, you most likely misspelled the timezone identifier. 

We selected 'Europe/London' for 'BST/1.0/DST' instead

see also

gnu/linux uname and lsb_release

uname -a tells you which linux kernel you are using

$ uname -a

Linux myserver 2.6.30.10-105.2.23.fc11.i686.PAE #1 SMP Thu Feb 11 07:05:37 UTC 2010 i686 i686 i386 GNU/Linux

Linux myserver 3.8.0-22-generic #33~precise1-Ubuntu SMP Fri May 17 01:00:37 UTC 2013 i686 i686 i386 GNU/Linux

lsb_release tells you which gnu/linux distro you are using

$ lsb_release -a

LSB Version:    :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID:    Fedora
Description:    Fedora release 11 (Leonidas)
Release:    11
Codename:    Leonidas

No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 12.04.2 LTS
Release:    12.04
Codename:    precise

ssh without passwords

local host

  • ssh-keygen -t rsa
  • cd .ssh
  • vi id_rsa.pub (COPY SSH KEY)

remote host

  • ssh-keygen -t rsa
  • cd .ssh
  • touch authorized_keys
  • chmod 600 authorized_keys
  • vi authorized_keys (PASTE SSH KEY)

see also