Install Wordpress Di Debian linux

Embed Size (px)

Citation preview

  • 7/27/2019 Install Wordpress Di Debian linux

    1/4

    iPad, aber

    Speed-up your Mac

    Install WordPress on Debian 5 (Lenny)

    Update: As Ubuntu is quite similar to Debian, this howto can also

    be used for Ubuntu systems. Ive tested this guide with Ubuntu Server 10.04 LTS and Ubuntu

    Server 10.10 and I expect this to work on Debian 6 (Squeeze), too.

    In Lenny, WordPress is already part of the apt repository. The downsite is that its a quite old

    version. So this little howto describes how to install the latest WordPress version (currently

    its 3.0.5) from its tarball by still retaining Debians file locations. You need a running LAMP

    configuration and root permissions to perform the next steps. Ill use YOUR.DOMAIN as a

    placeholder for your blog domain. Please replace it with your real domain, which is

    something like www.kaisblog.de.

    Before we start we need to check WordPress dependencies. Just type

    # apt-get install wordpress

    and select n to not install WordPress. If you see more packages than just wordpress you

    might want to install them now using apt-get install.

    We want to install WordPress in /usr/share, so cd into it:

    # cd /usr/share

    Now we need to get and unpack the latest WordPress version:

    # wget http://wordpress.org/latest.zip# unzip -e latest.zip

    This creates the wordpress directory. You can also download the .tar.gz version but for most

    plugins / themes you need unzip anyway. As Debian handles webapps like normal apps, we

    should create a config directory in /etc and copy the sample config into it:

    # cd wordpress# mkdir /etc/wordpress# cp wp-config-sample.php /etc/wordpress/wp-YOUR.DOMAIN-config.php

    http://www.kaisblog.de/2010/01/28/ipad-aber/http://www.kaisblog.de/2010/01/28/ipad-aber/http://www.kaisblog.de/2010/01/28/ipad-aber/http://www.kaisblog.de/2010/02/03/speed-up-your-mac/http://www.kaisblog.de/2010/02/03/speed-up-your-mac/http://www.kaisblog.de/2010/01/31/install-wordpress-on-debian-5-lenny/http://www.kaisblog.de/2010/01/31/install-wordpress-on-debian-5-lenny/http://www.kaisblog.de/2010/01/31/install-wordpress-on-debian-5-lenny/http://www.kaisblog.de/2010/02/03/speed-up-your-mac/http://www.kaisblog.de/2010/01/28/ipad-aber/
  • 7/27/2019 Install Wordpress Di Debian linux

    2/4

    Again, please replace YOUR.DOMAIN with your blog domain. In my case its wp-

    www.kaisblog.de-config.php.

    Now create a config file in /usr/share/wordpress/ that reads our config file in/etc/wordpress:

    # nano wp-config.php

    Paste the following code into it:

    Press CTRL+X to save the file and quit nano.

    mySQL

    Now its time to create a mysql database where WordPress stores its data in:

    # mysql -uroot -p

    Enter your mysql root password and youll see the mysql prompt. Well create a user and a

    database called wordpress:

    # GRANT ALL PRIVILEGES ON wordpress.* TO wordpress IDENTIFIED BY "S3cr3t!";# FLUSH PRIVILEGES;

    # quit

    Please replace S3cr3t! with your own password

    Now edit /etc/wordpress/wp-YOUR.DOMAIN-config.php and enter your mysql settings:

    # nano /etc/wordpress/wp-YOUR.DOMAIN-config.phpdefine('DB_NAME', 'wordpress');/** MySQL database username */define('DB_USER', 'wordpress');/** MySQL database password */define('DB_PASSWORD', 'S3cr3t!');

    /** MySQL hostname */define('DB_HOST', 'localhost');

    At the bottom of this config file youll find this line:

    /* That's all, stop editing! Happy blogging. */

    Please delete everything under this line as its already included in /usr/share/wordpress/wp-

    config.php

    Apache

  • 7/27/2019 Install Wordpress Di Debian linux

    3/4

    Debian handles apache sites in two different directories: /etc/apache2/sites-available and

    /etc/apache2/sites-enabled. We create a WordPress site config in /etc/apache2/sites-available

    and enable it with a2ensite when we are ready to do so.

    # nano /etc/apache2/sites-available/YOUR.DOMAIN

    Paste the following code into it:ServerName YOUR.DOMAINServerAdmin [email protected] /var/www/YOUR.DOMAIN/Options FollowSymLinksAllowOverride AllErrorLog /var/log/apache2/error.logCustomLog /var/log/apache2/access.log combinedLogLevel warn

    Again, press CTRL+X to save and exit nano.

    As you can see, our root directory is /var/www/YOUR.DOMAIN. Thats where Debian (and

    most other distributions) stores its websites. As our WordPress installation is in

    /usr/share/wordpress, we need to create a symlink:

    # ln -s /usr/share/wordpress /var/www/YOUR.DOMAIN

    Now we change some filesystem permissions to be able to upload content:

    # chown -R www-data:www-data ./wp-content

    If you want to change the look of your permalinks you need an writeable .htaccess file in

    your root directory and mod_rewrite to be enabled:

    # touch .htaccess# chown www-data:root .htaccess# a2enmod rewrite

    For this to work make sure you have AllowOverride All set for your document root. Our

    apache site config already has it included. After changing the permalinks (this can be donelater) you can make it read-only again:

    # chmod 440 .htaccess

    To enable your blog enter:

    # a2ensite YOUR.DOMAIN# apache2ctl restart

    You should now be able to open http://YOUR.DOMAIN/wp-admin/install.php in your

    browser and finalize your blog setup. Enjoy.

  • 7/27/2019 Install Wordpress Di Debian linux

    4/4