Category Archives: Linux

The Linux Category actually encompasses *BSD, RH, Fedora, Ubuntu, and the like.

LAMP on Debian

LAMP is Linux Apache MySQL PHP. Debian is the primary for Ubuntu.

Tried to install Ubuntu server 8.10 on an HP DL380 G4 with mixed results. Grub was failing on me. Instead of trying to fix it I just took a Debian 5 CD and wrote it over. Only problem is no LAMP – Ubuntu is much better for setting up initially, but both OSes are basically the same.

nano /etc/apt/sources.list
remove the cdrom

apt-get update
apt-get upgrade
apt-get install ssh-server

apt-get install apache2
apt-get install apache2-mpm-prefork
apt-get install php5

apt-get install mysql-server php5-mysql
apt-get install phpmyadmin
apt-get install webmin
apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi

nano /etc/apache2/apache2.conf
AddType application/x-httpd-php .php
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.shtml index.htm

I installed SSH so I could remotely do the rest of the work.

At this point, you should be able to go to http://youripaddress and see a generic “IT WORKS!” apache page.
You can also go to http://youripaddress/phpmyadmin and load up the phpmyadmin page. I suggest prohibiting this from being viewed outside your internal subnet using access rules in apache.
Then you can go to http://youripaddress:10000 and view the webmin page

Potential Problems:
Your repository list is incorrect.
nano /etc/apt/sources.list
deb ftp://ftp2.fr.debian.org/debian/ stable main contrib non-free
deb-src ftp://ftp2.fr.debian.org/debian/ stable main

You can not apt-get webmin:
wget http://voxel.dl.sourceforge.net/sourceforge/webadmin/webmin_1.460_all.deb
dpkg -i webmin-1.460_all.deb
apt-get install -f

You want ASP support on this Linux Box:
apt-get install libapache-asp-perl

You want to edit the sudoers list:
apt-get install sudo
visudo
Uncomment the following line:
%sudo ALL=NOPASSWD: ALL

ESXi Enable SSH

This is one of those topics that is very easy to find on google, but I’m posting anyway.

Go to the console of your VM ESXi machine
Press Alt + F1
The password is “unsupported”
vi /etc/inetd.conf
Find the #SSH, and move the cursor over the #
x
X will delete the character under the cursor. i for insert before cursor. r for replace the current character with the character typed next.
:wq
: puts the vi editor into the command mode, w for write, q for quit.
Reboot your server

Ubuntu Command Line Change IP Settings

I find myself forgetting more and more when I use tools like webmin. These usually work with most flavors of linux as well.

sudo nano /etc/networking/interfaces

auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255

Then restart the networking devices
sudo /etc/init.d/networking restart

*** EDIT 10/4/2017 ***
Almost a decade later and I had to update this slightly.

List Your Available Network Devices
ifconfig -a

List Your Currently Enabled/Working Network Devices
ifconfig

Edit Your Network Device
nano /etc/network/interfaces

auto ens32
iface ens32 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
dns-nameservers 192.168.3.2 192.168.3.3
dns-search domainname.local

Restart Your Network Device
ifdown ens32 && ifup ens32

*** EDIT 1/12/2018 ***
Only a few months later, but Ubuntu started using netplan instead of the usual ifup/ifconfig commands I’m used to. Now it’s yaml.
This is for 17.10 and later! Proper space is NEEDED to work.


nano /etc/netplan/01-netcfg.yaml

network:
version: 2
renderer: networkd
ethernets:
ens32:
dhcp4: no
addresses: [10.1.10.114/24,’IPV6HEREIFYOUWANT’]
gateway4: 10.1.10.1
nameservers:
search: [domain.local, otherdomain.tld]
addresses: [10.1.10.2, 10.2.10.2]

netplan apply

*** EDIT 2022-12-02 ***

Apparently this changed in Ubuntu 20.04 (although it still supported the “old way”), but in 22.04 I could not get netplan to support my use of the gateway4 option.

I’ve left the old style commented out, but the new way of using only routes for this purpose works well and opens up the idea of multiple gateways or static routes from a single system.

WordPress and Stats Pages

I have this issue from time to time – wordpress updates will break my stats pages. A simple edit in the .htaccess file clears this up.


RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC]
RewriteRule . - [L]

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Apt-get Not Upgrading The Kernel

If you run apt-get update and apt-get upgrade, it should upgrade most of the packages associated with your system.

However, there are certain files that will not be upgraded using these general commands.

We must run apt-get dist-upgrade instead.

***EDIT***

And this is how to upgrade from a lower version to a higher version:
apt-get install update-manager-core
do-release-upgrade

Ubuntu Disable Sounds

I always forget how to disable the “login ready” sound of the drums.

System >> Administration >> Login Window
Click on the Accessibility Tab
Uncheck the Login screen ready sound box

OR there’s the login and logoff sounds:

System >> Preferences >> Sound
Click on the Sounds Tab
Disable the Login and Logout sounds

***EDIT***
Apparently things are a little bit different in 9.10.

System > Preferences > Start Up Applications
Deselect the Gnome Login Sound

Now you will no longer hear the login noises.

Open up the terminal
sudo -u gdm gconftool-2 –-set /desktop/gnome/sound/event_sounds –-type bool false

Now you will no longer hear the startup noises.

Ubuntu 8.10 VERY Slow On HP Laptop

Not too long ago I retired my Compaq V5000 CTO Laptop in favor of a newer HP 6515b. The only thing I’m missing thus far is the long life battery I had on the V5000, but that can easily be fixed with a few $$.

I am a big fan of dual booting systems – it’s always a good idea to have a backup plan in case the first plan fails. I put Vista Enterprise SP1 x64 on my new laptop (I have to get used to Vista eventually since I do have to support the machines at work). I then waited patiently for 8.10 Ubuntu to be released.

Went to install x64 of Ubuntu – install took just over 2 hours. Odd. Then nothing is really working up to par with a 2.2GHz AMD X2. I’m sorry to say, but it’s so far been a bad experience. I figured maybe it was a 64bit issue – redownload and try to install 32bit. The installer is taking forever again, so I forgo the installer and reboot.

Then I looked on the Ubuntuforums for some answers.

Basically, the ACPI is not fully written for. ACPI is advanced configuration and power interface.
That and the APIC is not fully written for. APIC is advanced programmable interrupt controller.

I’ve been told that when you are installing Ubuntu, run it with the ACPI=OFF command, and then when it’s installed, remove the ACPI=OFF from the menu.lst and replace it with noapic.

Here’s the fix:
sudo nano /boot/grub/menu.lst
Then find where it says kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=bunchoflettersandnumbers ro quiet splash
We want it to say ro quiet splash noapic