[sf-lug] Apache & UBU configurations

Micah Lee micahflee at gmail.com
Fri Mar 18 20:28:21 PDT 2011


On 03/18/2011 04:01 PM, Eric W. Rasmussen wrote:
> 1st.  What size do you think my SWAP should be and at what priority? 
> Note that I am also vm'ing OSX and WIN7 with 2Gb RAM each and sometimes
> simultaneously.  I don't hibernate so I was thinking that 2Gb with a
> [vm.swappiness=10] would be fine.  Thoughts?

I have 8GB of ram in my Linux box too and I set myself up with an 8GB
swap partition. I read once long ago that it's good to give yourself
1.5x as much swap space as you have RAM so I was just being on the safe
side, but I honestly don't think I've ever used more than 1GB for swap.

> 2nd. What size should my /root partition be?  It looks like I am at
> 4.5Gb of 15Gb as I speak.  Maybe the following question might bring some
> clarity to my goals.

Depends on how you're partitioning, but I generally go the lazy/paranoid
route and have never had a problem with it:

Hard drive
- 1GB /boot
- Everything else encrypted LVM
  - 8GB (or however big) swap
  - Everything else /

It seems like separating out /var, /tmp, etc. helps with you from
fragmenting your partitions too much if you're doing something like
running a server that's constantly writing logs. I've never had a
problem with putting everything (besides /boot and swap) in the same
root partition.

> 3rd. I need to run a LAMP server for local web development.  Under Win
> this was easy using WAMP2.  But under Linux I am seeing that working
> with the /var/www/ directory is kind of a pain.  I have read that I
> might want to install a separate partition for /var. If so, what is a
> good size for multiple sites (I was thinking 10Gb). If I could have a
> /home/user/www directory so that read/write permissions aren't a problem
> and it is easily accessible, that would be even better.  Thoughts?

sudo apt-get install apache2 mysql-server mysql-client php5 php5-cli
php5-mysql php5-gd

The default webroot is /var/www in Ubuntu but real power is in using
vhosts and modifying your host file. Let's say you're playing with
wordpress. Open up /etc/hosts and add a line that looks like:

127.0.0.1 wordpress.local

Then create a new file called /etc/apache2/sites-enabled/wordpress.local
and put this in it:

<VirtualHost *:80>
  ServerName webworm.local
  DocumentRoot /home/eric/projects/wordpress
  ErrorLog /var/log/apache2/error.log
  CustomLog /var/log/apache2/access.log combined
</VirtualHost>

Now make a the right folders:

mkdir ~/projects
mkdir ~/projects/wordpress

And restart apache:

sudo /etc/init.d/apache2 restart

Now open up your browser and go to http://wordpress.local/ and you'll be
looking at a website served from /home/eric/projects/wordpress/docs.

Similarly, you can apt-get install phpmyadmin (which puts it in
/usr/share/phpmyadmin), add 127.0.0.1 phpmyadmin.local to /etc/hosts,
and create /etc/apache2/sites-enabled/phpmyadmin.local that has this in it:

<VirtualHost *:80>
  ServerName phpmyadmin.local
  DocumentRoot /usr/share/phpmyadmin
  ErrorLog /var/log/apache2/error.log
  CustomLog /var/log/apache2/access.log combined
</VirtualHost>

Restart apache, and now you can go to http://phpmyadmin.local/ to use
phpMyAdmin.

> 4th.  I hate trackpads on laptops and this is why I run with my external
> mouse.  Under Win, I could set the trackpad off whenever an external was
> plugged in.  Not so under Linux. I put this command [xinput set-int-prop
> "ETPS/2 Elantech Touchpad" "Device Enabled" 8 0] in my startup
> applications but it isn't activating.  I am getting tired of manually
> running the command every time I boot.  Thoughts?

No idea. :)

Also, I'm quite curious. How do you go about running OSX in a VM? I
tried awhile back and had nothing but failures (I found an OSX vmware
image once, but networking didn't work). Is it at all stable and easy to
set up?

Micah




More information about the sf-lug mailing list