Posts tagged sudo
Apache 2 Manage Modules and Sites – Configuration Structure
Feb 14th
Apache2 implements a structured method of organizing and enabling/disabling modules and sites. The default apache2 host is automatically turned on in /etc/apache2/sites-enabled/, and it includes the virtual hosting option. Therefore, by default, virtual hosting is enabled. Create your virtual host containers in /etc/apache2/sites-available, and then enable them by issuing the command:
sudo a2ensite xxxxx.com
VirtualHost containers are easy to format, and can point to any directory. An example virtualhost container is:
<VirtualHost *>
DocumentRoot /www/example1
ServerName www.example1.com
</VirtualHost>
# Other directives here
I tend to place the document roots in my main users home directory. Then chmod the entire document root with owner and group as your username, and then chmod it 775. A permission of 775 will give the owner and group write permissions. Then add www-data, the user running apache2, to your group:
sudo adduser www-data username
Now www-data can write to the document root, which comes in handy for many php solution including blogging software.
Modules are also managed using the a2 command. Use a2enmod/a2dismod respectively. Although with some modules like php5, when you install it the module is loaded automatically:
sudo apt-get install libapache2-mod-php5
Apache2 changed how the configuration files are coordinated. It is much more neater than containing everything in the httpd.conf file. Now there is the ports.conf file, and the sites-available/mod-available, and sites-enabled/mods-enabled directories. Essentially no real modification is required in the new apache2.conf file. The default listening port is configured in /etc/apache2/ports.conf.
Related articles by Zemanta
- How to Add Virtual Hostnames in Apache (helpdeskgeek.com)
- How To Set Up Apache2 With mod_fcgid And PHP5 On OpenSUSE 11.2 (howtoforge.com)
Remote Server Management in Local Facility – LTSP
Feb 13th
I’m using LTSP to manage a server remotely in a local facility. I setup an LTSP server on the host machine, and will place it in an air-conditioned room to preserve longevity. I configured a machine, of much lower power, to PXE boot from the server. There are several nuances to setting up an LTSP server. Once all is done you realize that it is less complicated that is can or needs to be. When things go right there is essentially three step in total. First:
sudo apt-get install ltsp-server-standalone
This installs the works. Then configured dhcp.
sudo nano /etc/ltsp/dhcpd.conf
Config the subnet to the same that you are using on your router. Clearly if your routers local ip is 192.168.0.1 your subnet would be 192.168.0.0. Then set a range. Make sure you turn off the dhcp servers in any and all routers connected to the network. You need the dhcp server on the machine to be the sole and only. Set the “next-server” option to the came local ip address of the server. Then set the rest of the options; domain, default gateway, dns…. Then reboot the server:
sudo /etc/init.d/dhcp3-server restart
Build the clients:
sudo ltsp-build-client
Thats really all there is to it. I’ve found that problems do arise, and instead of trying to fix them just purge all the installed applications and start over.
sudo apt-get remove --purge ltsp-server-standalone ltsp-server xinetd
One time I was stuck because there were two tftp inet servers, openbsd-inetd and inetd-hpa. They were conflicting. Then purge the autoremove function:
sudo apt-get --purge autoremove
Then start over installing ltsp-server-standalone. You can test your ltsp server using VirtualBox. Just like a real machine set the boot sequence to network as the first option. Now hook up a fancy monitor that can support 1920×1080 to the relatively low powered machine in the other room, and remotely manage your server from a pseudo local desktop environment.
Nvidia Driver on Linux – Easy, and Quick
Feb 7th

- Image via CrunchBase
There is a buzz that installing the Linux based Nvidia accelerated graphics driver is complicated. I consider it rather straight forward. First install build-essential, and the headers for your kernel. Those may appear to be some bigs words in the previous sentence, but it is really one line in a terminal window. Build essential installs GCC and its dependencies:
sudo apt-get install build-essential linux-headers-$(uname -r)
Now download the latest and greatest Nvidia driver. Choose the correct build type for your architecture. Conveniently save the file to your desktop and rename it to nvidia.run. The change your tty to another. To change to tty2 press control-alt f2.
Shut down gdm, which will stop X11:
sudo /etc/init.d/gdm stop
Or if you are using the new process manager in Ubuntu 9.10 you can use also:
sudo service gdm stop
Then execute the Nvidia installation script. Login to the command prompt and navigate to the desktop:
cd Desktop
sudo sh nvidia.run
Basically answer yes to everything, let the driver compile, and then when it asks you to configure the xorg.conf file, let it. Nowadays the Nvidia driver basically works out of the box. In the past, with Ubuntu in particular, you had to comment out the included driver in Ubuntu’s modules package, otherwise the custom compiled driver would not load on startup. The open source driver used to be commented out in /etc/default/linux-restricted-modules-common (comment NV); note that this is not needed any more except in Hardy (8.04).
Then start your gdm session, which will take you back to the login window, or your desktop depending on your startup settings:
sudo /etc/init.d/gdm start
Linux CUPS Configuration – Foomatic
Jan 16th
First install all needed packages. Your going to need cups, and the client, and the foomatic and openprinting drivers.
sudo apt-get install cupsys cupsys-client
Then install everything in:
sudo apt-cache search foomatic
If its an HP printer your going to want that library. HP has an auto setup script. Install the package and run:
sudo hp-setup
Installing all the foomatic, openprinting, and hp drivers the hp-setup script will detect printers on the network and will give you options as to which driver to use. To manage everything I recommend webmin. Download webmin from sourceforge, and use dpkg to install it. It will say dependencies are needed so just run:
sudo dpkg --configure -a
Webmin will install and you will access it from:
https://localhost:10000
You can configure other printers (other than HP) from here. You should set the printer to static ip address then you will configure the printer to that IP and port 9100. Select the corresponding from from the CUPS menu at the bottom of the printer configuration page. Some printers need a driver straight from openprinting.com. Copy the ppd to a folder in /var/share/ppd/openprinting. Create a folder with the manufacturers name if need be. Install it the same way as other printers (through webmin), and select the corresponding ppd drivers, in the CUPS section, the add new printer configuration page.
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=fe98f757-f8d7-492b-afd9-59769c3eacbf)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=6988a6ec-cec3-48df-b2ed-6f8f6859e942)


