Showing posts with label debian. Show all posts
Showing posts with label debian. Show all posts

19 May 2018

Install Wordpress on Debian "The Debian way"

There are quite a few websites with instructions on how to install the "LEMP" {Linux,(E)Nginx, MariaDB, PHP}. A simple search brings in a few on the first page of results, so I won't list any links here.

Installing nginx, mariadb and php on Linux is quite straight forward and nicely documented in several of those pages. However, they all end with the following to install Wordpress using something like:

$ wget https://wordpress.org/latest.tar.gz


i.e. downloading it directly from wordpress.org. I use Debian on my servers and prefer to install packages using Debian's native package manager, apt. This way, they get all security updates using a single command.

So, I thought why not try to install Wordpress "The Debian way". My attempt to do that showed that it requires apache2 and some other apache2 modules too! This was odd when nginx-full, which provides httpd, was already installed.

user1@debian$ sudo apt install wordpress
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following additional packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils javascript-common libao-common libao4
  libapache2-mod-php libapache2-mod-php7.0 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap libflac8 libjs-cropper libjs-prototype libjs-scriptaculous liblua5.2-0 libogg0
  libphp-phpmailer libspeex1 libvorbis0a libvorbisenc2 libvorbisfile3 php-gd php-getid3 php7.0-gd
  ssl-cert vorbis-tools wordpress-l10n wordpress-theme-twentyseventeen
Suggested packages:
  www-browser apache2-doc apache2-suexec-pristine | apache2-suexec-custom libasound2 libaudio2
  libesd0 | libesd-alsa0 libpulse0 libsndio6.1 php-pear php-league-oauth2-client
  php-league-oauth2-google speex openssl-blacklist php-ssh2
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils javascript-common libao-common libao4
  libapache2-mod-php libapache2-mod-php7.0 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap libflac8 libjs-cropper libjs-prototype libjs-scriptaculous liblua5.2-0 libogg0
  libphp-phpmailer libspeex1 libvorbis0a libvorbisenc2 libvorbisfile3 php-gd php-getid3 php7.0-gd
  ssl-cert vorbis-tools wordpress wordpress-l10n wordpress-theme-twentyseventeen
0 upgraded, 32 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.3 MB of archives.
After this operation, 71.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort!


If you look at Wordpress package details (apt show wordpress), it depends on "libapache2-mod-php or libapach2-mod-php5 or php or php5". Also, when installing php, we installed packages specifically php-fpm and php-mysql, it didn't install the packages php or php5. As the dependency list has libapache2-mod-php listed first, it asks for other dependent packages which inturn recommend apache2. To fix this, install package php and then install wordpress, and no apache2 packages will be required.

user1@debian$ sudo apt-get install php wordpress       
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following additional packages will be installed:
  javascript-common libao-common libao4 libflac8 libjs-cropper libjs-prototype libjs-scriptaculous
  libogg0 libphp-phpmailer libspeex1 libvorbis0a libvorbisenc2 libvorbisfile3 php-gd php-getid3
  php7.0 php7.0-gd vorbis-tools wordpress-l10n wordpress-theme-twentyseventeen
Suggested packages:
  libasound2 libaudio2 libesd0 | libesd-alsa0 libpulse0 libsndio6.1 php-league-oauth2-client
  php-league-oauth2-google speex php-ssh2
The following NEW packages will be installed:
  javascript-common libao-common libao4 libflac8 libjs-cropper libjs-prototype libjs-scriptaculous
  libogg0 libphp-phpmailer libspeex1 libvorbis0a libvorbisenc2 libvorbisfile3 php php-gd
  php-getid3 php7.0 php7.0-gd vorbis-tools wordpress wordpress-l10n
  wordpress-theme-twentyseventeen
0 upgraded, 22 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.0 MB of archives.
After this operation, 59.9 MB of additional disk space will be used.
Do you want to continue? [Y/n]


You can continue with the rest of the configuration of Wordpress with help from https://wiki.debian.org/WordPress (configuration steps to be posted). Oh, and don't forget to setup HTTPS using certbot to use the SSL certificates from Let's Encrypt.

* the investigation several searches on the web, but the only place where I got helpful information was the good old lists.debian.org.

Note: all this was on a Debian 8.0/Stretch VM

29 May 2016

Extending LVM volume

An LVM setup on a physical disk helps to increase the logical volume size in case it is almost full. Steps to be able to extend a logical volume, when there is free space on the physical volume:

  1. Unmount the volume
  2. Check if there is free space on physical volume (if no, need to add physical volume and extend group first)
  3. Extend logical volume using $> sudo lvextend -L+10G /dev/gp02/virtual
  4. Run fsck on logical volume: $> sudo e2fsck -f /dev/gp02/virtual
  5. Extend the file system on the logical volume: $> sudo resize2fs /dev/gp02/virtual
  6. Mount the logical volume: $> sudo mount -t auto /dev/gp02/virtual /virtual
Where:
/dev/gp02/virtual - is the logical volume
-L+10G - adds 10 GiB to the logical volume

In case there is no free space left on the physical volume, one needs to add a new physical volume to the group and then extend the logical volume.

References:
LVM HowTo [tldp.org]
Debian LVM [debian.org]
Working with LVM [debian-administration.org]

21 December 2015

Debian/Apt and disk space

For a few days I was getting the following error when trying to do an apt-get update on my Debian/Stretch machine

~$ sudo apt-get update
Get:1 http://mirror.csclub.uwaterloo.ca stretch InRelease [200 kB]
Ign http://mirror.csclub.uwaterloo.ca stretch InRelease                       
Ign http://mirror.csclub.uwaterloo.ca stretch Release.gpg                     
Get:2 http://security.debian.org stretch/updates InRelease [62.8 kB]
Ign http://security.debian.org stretch/updates InRelease
Ign http://security.debian.org stretch/updates Release.gpg
Ign http://security.debian.org stretch/updates Release
Get:3 http://security.debian.org stretch/updates/main i386 Packages/DiffIndex [1,554 B]
Ign http://security.debian.org stretch/updates/main i386 Packages/DiffIndex
Get:4 http://security.debian.org stretch/updates/main Translation-en [14 B]
Get:5 http://security.debian.org stretch/updates/main i386 Packages [32 B]
Get:6 http://security.debian.org stretch/updates/main i386 Packages [32 B]
Ign http://security.debian.org stretch/updates/main Translation-en_CA
Ign http://security.debian.org stretch/updates/main Translation-en
Err http://security.debian.org stretch/updates/main i386 Packages
  404  Not Found [IP: 128.31.0.63 80]
Hit http://mirror.csclub.uwaterloo.ca stretch Release
Get:7 http://mirror.csclub.uwaterloo.ca stretch/main i386 Packages/DiffIndex [16.6 kB]
Ign http://mirror.csclub.uwaterloo.ca stretch/main i386 Packages/DiffIndex
Get:8 http://mirror.csclub.uwaterloo.ca stretch/main Translation-en [4,902 kB]
Get:9 http://mirror.csclub.uwaterloo.ca stretch/main i386 Packages [7,440 kB]
Get:10 http://mirror.csclub.uwaterloo.ca stretch/main i386 Packages [7,440 kB]
Err http://mirror.csclub.uwaterloo.ca stretch/main Translation-en_CA
  Bad header line [IP: 129.97.134.71 80]
Err http://mirror.csclub.uwaterloo.ca stretch/main Translation-en
  Bad header line [IP: 129.97.134.71 80]
Err http://mirror.csclub.uwaterloo.ca stretch/main i386 Packages
  Bad header line [IP: 129.97.134.71 80]
W: Failed to fetch http://security.debian.org/dists/stretch/updates/main/binary-i386/Packages  404  Not Found [IP: 128.31.0.63 80]

W: Failed to fetch http://mirror.csclub.uwaterloo.ca/debian/dists/stretch/main/i18n/Translation-en_CA  Bad header line [IP: 129.97.134.71 80]

W: Failed to fetch http://mirror.csclub.uwaterloo.ca/debian/dists/stretch/main/i18n/Translation-en  Bad header line [IP: 129.97.134.71 80]

W: Failed to fetch http://mirror.csclub.uwaterloo.ca/debian/dists/stretch/main/binary-i386/Packages  Bad header line [IP: 129.97.134.71 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.


Trying to rule out problems due to network, I verified the the URL giving the error 404 in the browser and it worked fine. Then I checked my disk space as it was usually the culprit before I rebuilt the OS on a 80GB HDD (earlier the OS was in 4GB!). The /var partition was indeed used 100%. Applying the usual trick of apt-get clean did release much space!

On closer investigation, I noticed the kern.log and syslog files in /var/log/ were huge (kern.log 3.6GB, syslog 248 MB). The kern.log and syslog had error/warning splattered repeatedly such as:
Dec  1 07:36:00 imlee kernel: [1155666.501321] nouveau E[  PGRAPH][0000:01:00.0]  NOTIFY nsource: STATE_INVALID nstatus: INVALID_STATE BAD_ARGUMENT

Reducing the size of kern.log/syslog to 0 fixed the apt-get issue!The Debian/Stretch machine is uptodate again.

16 March 2015

Updating Flashplayer in Debian GNU/Linux

Check for latest version
user@localhost $> sudo update-flashplugin-nonfree --status
Flash Player version installed on this system  : 11.2.202.442
Flash Player version available on upstream site: 11.2.202.451
flash-mozilla.so - auto mode
  link currently points to /usr/lib/flashplugin-nonfree/libflashplayer.so
/usr/lib/flashplugin-nonfree/libflashplayer.so - priority 50
/usr/lib/gnash/libgnashplugin.so - priority 10
Current 'best' version is '/usr/lib/flashplugin-nonfree/libflashplayer.so'.
So a new version is available. To upgrade, use following command:
user@localhost $> sudo update-flashplugin-nonfree --install
--2015-03-16 00:21:59--  https://fpdownload.macromedia.com/get/flashplayer/pdc/11.2.202.451/install_flash_player_11_linux.x86_64.tar.gz
Resolving fpdownload.macromedia.com (fpdownload.macromedia.com)... 23.72.80.8
Connecting to fpdownload.macromedia.com (fpdownload.macromedia.com)|23.72.80.8|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7244055 (6.9M) [application/x-gzip]
Saving to: ‘/tmp/flashplugin-nonfree.tsRdJVFLnj/install_flash_player_11_linux.x86_64.tar.gz’

     0K .......... .......... .......... .......... ..........  0%  674K 10s
    50K .......... .......... .......... .......... ..........  1%  561K 11s
   100K .......... .......... .......... .......... ..........  2%  687K 11s
   150K ..........

    ........ ........ snip ....... ........
   7000K .......... .......... .......... .......... .......... 99%  548K 0s
   7050K .......... .......... ....                            100%  917K=12s

2015-03-16 00:22:11 (613 KB/s) - ‘/tmp/flashplugin-nonfree.tsRdJVFLnj/install_flash_player_11_linux.x86_64.tar.gz’ saved [7244055/7244055]

Check version again:
user@localhost $> sudo update-flashplugin-nonfree --status
Flash Player version installed on this system  : 11.2.202.451
Flash Player version available on upstream site: 11.2.202.451
flash-mozilla.so - auto mode
  link currently points to /usr/lib/flashplugin-nonfree/libflashplayer.so
/usr/lib/flashplugin-nonfree/libflashplayer.so - priority 50
/usr/lib/gnash/libgnashplugin.so - priority 10
Current 'best' version is '/usr/lib/flashplugin-nonfree/libflashplayer.so'.

Latest version installed.

In Mozilla Firefox, to check if it is using the latest version, open page about:plugins. If it is not the latest version, close Firefox completely and restart.

Reference & details see: FlashPlayer [wiki.debian.org]

2 May 2010

Debian/KDE 4.4.3 Upgrade

I did an aptitude safe-upgrade today and was pleasantly surprised to see that KDE 4.4.3 was finally in unstable. The only problem I had with the upgrade was that I got a black screen when I tried to re-login to KDE.

I didn't find much on Google or Debian lists but this post on KDE gave me an indication and I checked the status of the package plasma-desktop. dpkg told it was uninstalled at some point. I installed it using aptitude and lo-and-behold, I was able to login the new version of KDE.

25 January 2010

Linux Wireless Access Point - v2

After struggling with various networking issues with my older wireless card (the discontinued D-Link DWL-G520), I purchased a DWA-552 for $60+tx. I used the DWL-G520 for almost 2 years as my access point. But it never worked in WPA2 mode and always had problems with two (Windows) machines, iPod Touch and my Nokia trying to connect to it. I had to restart hostapd after either the iPod or the Nokia tried to connect as it would stop working.

I had setup madwifi with hostapd for the DWL-G520 earlier. But as madwifi was removed from Debian repos, DWA-552 was the only PCI wireless adapter supported by the linux kernel's ath9k module. That required me to update to the the newest kernel 2.6.30. ath9k works out of the box with this kernel in master mode.

Setup was easy as most of the work was already there. I had to setup my hostapd.conf to use WPA2 and changed the network interface from ath0 to wlan0. Restarting networking and hostapd gave me the wlan0 interface and both the iPod and the Nokia were able to detect the SSID.

Last but not the least, all this was accomplished with help from Robert's post. Thanks for documenting your experience with ath9k.

The next thing to do is to see if it will work in the N-mode. That is for another day, as I'm late to go to bed (...again) by an hour.

22 February 2009

Spotting Debian

This post is for Debian logo spotted in daily life. This photo was take by a friend of mine in France. The place was a pottery artists gallery in St. Pere, Vezelay, France (excuse absence of accents, because of keyboard issues). You can see the swirl in the mortar bowl in white.

10 November 2008

Art Quilts XIII: Lucky Break

For those who love Debian or other open source projects: Chandler Center for Arts is hosting an exhibition titled Art Quilts XIII: Lucky Break. The highlight for the Debian or open source community is the "Debian" quilt made by Thelma Smith promoting Debian/GNU Linux and open source software in general.

Below is a glimpse of the unfinished quilt along with wonderful detail of the artwork in the close up. More than 2years of hard work has gone into realizing the quilt. The quilt is NFS but if anyone is interested they can contact Thelma for commissioning another or maybe one with a bunch of people holding hands in a cirle ;). Dimensions of this quilt are approx. 6'x4'.

Debian Quilt - Unfinished


Debian Quilt - Detail

For those of you interested in Debian and art (or just open source); the exhibition runs from 7th Nov. 2008 to 31st Nov 2008. Admission is FREE.

Chandler Center for the Arts
250 N. Arizona Ave.
Chandler, 85225

1 May 2007

Debian on MacBook Pro - Docs

The first draft of the procedure for installing Debian on a USB disk connected to a MacBook Pro is up. You can find it here. Leave a comment for improvements and pointers.

I haven't had the time to setup the hardware e.g. mousepad, wireless, backlight, etc. to work in Debian yet. But that information can easily be found on wiki.d.o. The page will be updated as I try the tricks.

29 April 2007

Debian/Lenny on MacBook Pro USB

I had been trying to install Linux on a 1GB USB flash drive connected to my MacBook Pro (MBP) since the past few months. Although there are several places describing how to do it using either Boot Camp or by resizing the hard disk partitions, my sole requirement was no changes to the Mac OS X installed on the hard disk.

Boot Camp was out of question as its main aim is to help install Windows by providing drivers for the Mac hardware. The other option was using rEFIt and resizing the hard disk. I had tried this earlier with mactel-linux patches for the kernel and was able to get a login prompt but no video. That process involved several steps using debootstrap and compiling the kernel with the patches.

However, with the release of Debian 4.0 (Etch), the debian-installer also got a lot of attention and installs a relatively new 2.6.18 kernel. So armed with a netinstall d-i CD (23 April build, 26th doesn't recognize network card) I was able to install Debian Testing (Lenny) on the USB disk with XFCE4 as the desktop environment with 130MB of swap space partition and 157MB to spare after installing dillo web browser.

The installation of Lenny on the USB flash disk has not required any change on the internal MBP hard disk and the Mac OS X installation is completely oblivious of the Debian install. If I don't press the "Option" button at boot time, Mac OS X boots up, otherwise with the USB connected it asks which OS to boot.

Next post gives the link for installation steps. The process was based on information gathered mainly from the Debian wiki's Macbook and Macbook Pro pages, and also here.

8 April 2007

Its Out!

After a delay of about 5months, Debian GNU/Linux 4.0 codenamed Etch has finally been released. This release comes 22 months after Sarge was released. Other major happenings in the Debian world were the Sarge update 3.1r6 and electing of Sam as the new Debian Project Leader. Now the craziness begins as updates with new packages will fall in to unstable and testing branches.

I will be continuing my Debian party when this finishes.

24 February 2007

Grip Rocks

I had an old audio CD which wasn't playing too well, so I thought of ripping it and burning a new one. Yesterday I ripped tracks 1 to 7, and the 8th track took around 3hrs. I started ripping of the 9th track around 15hours ago, and it is 41% done. I am using Grip to rip the CD and it has been chugging along bit-by-bit literally. I won't mind waiting another 24hours to get the 9th track ripped. Grip hasn't quit on the CD yet, so all I can say for it is that simply rocks.

Update: Finally, Grip has finished ripping the track taking about 38hours in all. I have the complete .wav file. Yippeeee :)

19 January 2007

CSS Oddity

Lesson: Thou shalt not use CSS to obscure unpredictable text for ye users.

Skin deep advantage of CSS is that it can be used to make web pages beautiful and possibly perform some tricks without other tools like Javascript. However, when one doesn't know what the content of the page will be, CSS might actually end up obscuring that part of the page. An example is the occurence of heading tags h1, h2, etc. in people's blog posts on Planet Debian. For the planet, date is a level 1 heading, each person's name is a level 2 heading and title for each post is a level 3 heading. When a post contains either of the h1 or h2 level headings, it looks like the image shown below. Notice that the circled heading (h1) is hardly readable while the post's matter is!


This happens because tje CSS for the planet makes the h1 and h2 to have a letter-spacing of -2 pixels due to h1 and div.channel h2 selector definitions. The problem starts when a person's post contains either a level 1 or level 2 heading. The div.content h* selector (where * = 1,2,...6) makes all of them to have a font-size of 100% and the reduced letter spacing in addition to the default bold font-weight of headings make them almost unreadable (Firefox, IE6, Konqueror). The reason behind this is that the letter-spacing: -2px definition is being applied to all h1 headings and all descendant h2 headings of div.channel selector. If we remove the letter-spacing in the level 2 heading in the post(shown above), it should look as shown below.


In such cases where the content is not predictable, CSS rules should take into account both the static and variables parts separately. A style sheet which took care of the static part using child selectors and separate selectors for content styling would have suited Planet Debian more. Using the suggested separation method, a child selector e.g. div.channel>h2 would not make the div.content h2 to be with reduced letter spacing and thus leaving headings in posts to be more easily legible as show by the second image above.

So although using CSS gives many advantages, using it without giving a real consideration to the actual content of the page, however unpredictable it may be, one can end up with difficult to read content due to misused CSS rules.

This post will help me with a visual example of the different between descendant and child selectors. I hope it serves useful purpose to others too. Have fun CSSifying your pages.

10 January 2007

Etch: Two digit level RC Bugs

I have been checking the number of RC bugs in Etch since Nov'06 and had expected them to fall below 100 around first week of December. But then they kept hovering around 115 and never went down till the first week of January.

Hmm... it seems it was not only me who was waiting to see the RC bugs for Etch go down to two digit level i.e. <100. Sam put up the perfect picture to celebrate this. Etch seems to be a lot closer with the number of bugs falling below 100.