Apache 2.2 Browser-Caching

If you want to enable the browser cache with the new Apache 2.2, you have to enable the module rewrite first and then to restart the Apache:

sudo a2enmod rewrite && /etc/init.d/apache2 restart

Add this to the File “/etc/apache2/apache2.conf” :

<ifmodule mod_expires.c>
ExpiresActive on
ExpiresByType image/x-icon “access plus 2 month”
ExpiresByType image/png “access plus 2 month”
ExpiresByType image/jpg “access plus 2 month”
ExpiresByType image/gif “access plus 2 month”
ExpiresByType image/jpeg “access plus 2 month”
ExpiresByType application/pdf “access plus 2 month”
ExpiresByType audio/x-wav “access plus 2 month”
ExpiresByType audio/mpeg “access plus 2 month”
ExpiresByType video/mpeg “access plus 2 month”
ExpiresByType video/mp4 “access plus 2 month”
ExpiresByType video/quicktime “access plus 2 month”
ExpiresByType video/x-ms-wmv “access plus 2 month”
ExpiresByType application/x-shockwave-flash “access 2 month”

ExpiresByType text/css “access plus 24 hour”
ExpiresByType text/javascript “access plus 2 hour”
</ifmodule>

This is an example config, for images I choose 2,CSS 1day and for JavaScript 2 Hours from the last access.

Search engine optimization (SEO)

This article is how to improve the search engine rank like Google, Baidu, DuckDuckGo, Yahoo or Yandex.

 

Robots.txt and Sitemap

The “Robots.txt” lets the Search engines know what directory’s are allowed to crawl and what not.

The Sitemap is a map where all pages are listed so the Search engine could index all your pages.

My “Robots.txt” :

User-agent: *
Disallow: /wp-admin/

Sitemap: http://scheinast.eu/sitemap.xml

I allow to crawl everything excepted my admin folder, and I show them my site map so they know what’s all on my Blog.You could use a plug-in for your Blog or generate them by yourself, for self-made look at Sitemap Generator and for Plug-in here.

For a live preview you could see my Robts.txt here and my Site map here.

Now its better to say the search engines that you homage is new, but you could wait until they find you too.To add your web page to Google webmaster-tools click here and for Bing here.In both tools you have nice features to see how many pages are ready for the search or how many users are on your page.

Meta tags

Then you should fill up your meta tags like description and keyword so the Search engine knows what’s the theme about you homepage, I use this plug-in: Add Meta Tags.

back links

Back links are links from other pages to your page, so the search engine thinks your page have a lot of important information.For building back links you find enough tools via google.

Content

Its very important to bring good content so back links would build from alone.

Share buttons and social pages

Make your own social page and use an auto poster like this and like buttons like this to make your platform available in social networks.This brings good back links and a more users on your page.

push social

To push your social network you could try like4like and always bring new good content.

As an example my social network links: facebook profile, facebook page, blogger, twitter, blogspot, delicius, tumbler, wordpress and google plus.

Captcha

I use captchas to avoid spam on my blog but it is a problem for search engines if they don’t access to your web page so don’t overuse them.Another problem is flash,search engines are not able to read that so avoid it.

JavaScript in word press post

Sometimes I want to post some examples about JavaScript and html, but word press removes the JavaScript so it don't work, for that I installed the JavaScript-Inline-Plugin now you could wrote your code like that:



<html>
</html>
But don't forget so do this in the Text tab, and if you move back to Visual its gone... that's annoying but the best what I found ....

WordPress Backup Script

I made a simple script to backup my word press every day at 12:30, if you want to make it by hand look at Backup WordPress. script
#mysqldump
mysqldump --databases --opt -Q -uroot -pPASSWORD wordpress | gzip > database.gz
#create archive
tar -cvpzf   "/Backup/"`date +%d-%m-%Y`".tar.gz" ./database.gz /var/www/
#copy to backupserver
sshpass -pPASSWORD scp  "/Backup/"`date +%d-%m-%Y`".tar.gz" root@server.local:/volume1/DATA/BACKUP
#delete
rm "/Backup/"`date +%d-%m-%Y`".tar.gz"
  Install save this script at your server, I choose "/root", then run this:
mkdir /Backup;
chmod +x /root/backup.sh;
apt-get install sshpass;
now we add this to the cronjob:
crontab -e
and add this line:
 10  8 * * * /root/backup.sh
then wait and test if your server shows the backup files.

install ownCloud on a NAS

I want to install ownCloud on my NAS Server Synology ds415+ to share files, at first we download the install files from here.Then upload this file to your NAS and open it in the Browser if you got an permission error look at disk station manager synology – change web rights.Then follow the instructions and if you only have to run this service on your server you cloud install it in the current folder with a dot.And I prefer to use as database mariaDB over liteSQL. And now we are done: Bildschirmfoto vom 2015-03-29 17:25:42

wordpress backup problems with rewrite

I set up my new word press to my new Silent Server, after I moved the database and the ftp folder I had some troubles with the permalinks, this shows how to solve them. Set Rights navigate to your www folder, my one is at "/var/www", then set the rigthts, user and the group:
chmod -R 755 ./
chown -R www-data:www-data ./
Set rewrite now I check if rewrite is enabled:
a2enmod rewrite
now open apache2.conf with:
nano /etc/apache2/apache2.conf
and add this line:
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
now open sites-available/default with:
nano /etc/apache2/sites-available/default
and change this:
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
to this:
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
  After you made your changes restart your web server:
service apache2 restart

apache2 Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration

I got this error today:
Syntax error on line 203 of /etc/apache2/apache2.conf:
Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
This happen if the headers module from apche2 is missing. Install with:
a2enmod headers
then restart the apche2:
service apache2 restart
Now it should work.

Backup WordPress

Its importand to make Backups, and so we make a backup from our wordpress. At first we copy all files from our server to the local host: copyI used the integrated FTP manage but you could use another FTP program too.   Now we make a dump from our database, login into your phpmyadmin, and then: phpmyadmin
  1. Export
  2. manual to choose what database (only wordpress)
  3. if you want to backup all (more than wordpress)
  4. only wordpress
  5. compress to save store
phpmyadmin_ok Now hit the OK Button and download the File. If you have to use your backup look at : wordpress backup problems with rewrite. For a backup script look at WordPress Backup Script.