Category Archives: Programming

Write cookies with Apache

If you want to write cookies with Apache, you must use mod_headers. After this you can set cookies from every conf file: Header append set-cookie: “MyCookie=myValue; path=/;”

Increasing the size of /tmp

If you reach the limit of /tmp, an easy was to fix this is to create a symbolic link and to map /tmp to a partition with more space. 1. Quit all running applications 2. Become super user: #su – root 3. Delete the content from /tmp: #rm -r /tmp 4. Create the symbolic link: # ln… Read More »

Rewrite rules in .htaccess

RewriteEngine On RewriteBase   /mydir RewriteRule ^mydir/(.*) http://my_other_server.com/other_dir/$1 [P] RewriteRule    ^mydir/$  http://my_other_server.com/cgi-bin/other_dir/index.cgi [P] RewriteRule    ^cgi-bin/other_dir/index.cgi(.*)  http://my_other_server.com/cgi-bin/other_dir/index.cgi$1 [P] # RewriteCond %{REQUEST_URI}  ^index.cgi* RewriteRule   ^index.cgi(.*)  http://my_other_server.com/cgi-bin/other_dir/index.cgi$1 [P] RewriteRule    ^mydir/index.cgi(.*)  http://my_other_server.com/cgi-bin/other_dir/index.cgi$1 [P] RewriteEngine On RewriteBase   /mydir RewriteRule ^mydir/(.*) http://my_other_server.com/other_dir/$1 [P] RewriteRule    ^mydir/$  http://my_other_server.com/cgi-bin/other_dir/index.cgi [P] RewriteRule    ^cgi-bin/other_dir/index.cgi(.*)  http://my_other_server.com/cgi-bin/other_dir/index.cgi$1 [P] # RewriteCond %{REQUEST_URI}… Read More »

Apache variables

Server Variables are variables set by Apache, and held inside the super global array ‘$_SERVER’. They hold very interesting snippits of data available for use, and become very useful when developing PHP projects. $_SERVER[‘REQUEST_URI’] It return the URL in to access the page which is executing the script. If you need to type http://www.example.com/product.php?id=5 to… Read More »

Using Include into Virtual Host

If you want you can include other configuration file into a Virtual Host, but you must not define any other <VirtualHost *:8080> Include /etc/apache2/conf.d/my_other_conf/*.conf </VirtualHost> If you don’t define the virtual host *:80, all the configuration from standard httpd.conf will be loaded in all other Virtual Host.

Enable Apache 2 modules in OpenSuSE 11

OpenSuSE 11 has a strange and funny way for loading the modules. If you try to load modules by modifying an .conf file, you will be surprised when you will realize that at the restart, your change will be lost. You have two options: 1. Load that modules only when you need it, in a custom… Read More »

Apache mod_rewrite and OpenSuSE 11

If you have OpenSuSE 11, you will have a big surprise when you try to use mod_rewrite. You will not find any mod_rewrite. The only think you must do is to activate mod_rewrite with the following command: # a2enmod rewrite # rcapache2 restart

Configure SMTP server for Sendmail

If you want to set up the default SMTP server for Linux you have to go to YaST2: YaST2 -> Network services -> Mail Transfer Agent -> Standard -> Permanent -> your outgoing smtp server (use Masquerading to mask your local machine, use Authentification for authentification purpose) -> Finish