Forums / Installing on a Linux/Unix Server / Ubuntu Dapper Install howto

Ubuntu Dapper Install howto

Locked

Started by brightidea on 20 Aug 2006, 5:36 PM · Views: 14,718

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
20 Aug 2006, 5:36 PM
#1
brightidea avatar

brightidea

New Zenner

Join Date:
Aug 2006
Posts:
18
Plugin Contributions:
0

Ubuntu Dapper Install howto

Hi,

I want to go through and install zen-cart on a ubuntu dapper server, but wanted to document the whole install specific to ubuntu. Im doing this for my own sanity, but also so anyone can just go through this.
This will create a ssl enabled site without a CA certificate - good for testing. i think it gives you a months usage, if you need longer type "sudo apache2-ssl-certificate --force"

Whats the best permissions for after install? or are the pre-install ones fine?

This is what i have for the documentation so far, could you check this and let me know of any errors or additions required:

This gets you up to the point of logging in to the server and configuring it from there.

Install ubuntu dapper server with LAMP stack
Perform updates (sudo apt-get update) (sudo apt-get upgrade)
make sure server is only contactable by the person installing
edit hosts to make sure FQDN is correct - second line needs your ip
sudo vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.0.100 server1.example.com server1

install some basic apache security measures
apt-get install libapache2-mod-security
a2enmod mod-security
/etc/init.d/apache2 force-reload

NB: register globals = off & php safe mode = off are set in ubuntu dapper already
Install openssh (sudo apt-get install openssh-server)
instal ntpdate to ensure servers time is right and sync time
sudo apt-get install ntp ntpdate
sudo ntpdate uk.pool.ntp.org (if in uk)
using a pc with web browser download zencart - might be worth having a zencart-latest-full.tar.gz so it can be scripted
extract zencart zip file.
using sftp client of choice, copy zen cart into home directory
remove ssh - for security reasons - only if possible
sudo apt-get remove openssh-sever
connect directly into server
Set mysql password (mysqladmin -u root password newrootsqlpassword) (mysqladmin -u root -p -h localhost password newrootsqlpassword)
create zencart database & user
mysql -u root -p
mysql> CREATE DATABASE zencart;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON zencart.* TO 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword';
mysql> \q
cd into zencart directory
move zencart to /var/www (sudo mv * /var/www) (or have this in a sub-directory - your site, your call)
cd /var/www
set pre-install permissions & create configure.php files

sudo chmod -R 777 ./cache
sudo chmod -R 777 ./pub
sudo chmod -R 777 ./images
sudo chmod -R 777 ./includes/languages/english/html_includes
sudo chmod -R 777 ./media
sudo chmod -R 777 ./pub
sudo chmod -R 777 ./admin/backups
sudo chmod -R 777 ./admin/images/graphs
sudo touch ./includes/configure.php
sudo touch ./admin/includes/configure.php
sudo chmod 777 ./includes/configure.php
sudo chmod 777 ./admin/includes/configure.php

enable apache ssl & port 443
	sudo a2enmod ssl
	sudo vi /etc/apache2/ports.conf - add a second line with "Listen 443" without quotes
	sudo /etc/init.d/apache2 force-reload

	The next step will ask you a few questions about the site:
		apache2-ssl-certificate

	sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/site-ssl
	sudo vi /etc/apache2/sites-available/site-ssl
	change NameVirtualHost * to NameVirtualHost *:443
	change <VirtualHost *> to <VirtualHost *:443>
	add the below before </VirtualHost>
		SSLEngine on
		SSLCertificateFile /etc/apache2/ssl/apache.pem
		SSLProtocol all
		SSLCipherSuite HIGH:MEDIUM
	sudo a2ensite site-ssl
	sudo /etc/init.d/apache2 restart

Post Install
delete zc_install
sudo rm -r zc_install
set /includes/configure.php & admin/includes/configure.php as read only
sudo chmod 444 ./includes/configure.php
sudo chmod 444 ./admin/includes/configure.php
The next few steps make it just a little bit harder to detect what your running
restrict the apache2 response in apache.conf, add
ServerSignature Off
ServerTokens ProductOnly
change expose_php=On in php.ini to:
expose_php=Off

20 Aug 2006, 8:06 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Ubuntu Dapper Install howto

Here's a couple guides for installing an older version of Zen Cart to a Red Hat server:
http://www.zen-cart.com/archived_contributions/documentation/zencart_installation_on_red_hat_linux.pdf
or Mandrake:
http://www.zen-cart.com/archived_contributions/documentation/zencart_installation_on_mandrake_linux.pdf

you might glean a few extra tips from them.

You asked about what the right permissions are post-install. Defaults of folders=755 and files=644 are fine for most files, depending on your needs.
You may also consider this security article (which is also in the /docs folder of your Zen Cart ZIP contents):
http://www.zen-cart.com/wiki/index.php/Important_Site_Security_Recommendations

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Aug 2006, 7:16 AM
#3
funkey avatar

funkey

New Zenner

Join Date:
Jul 2005
Posts:
85
Plugin Contributions:
0

Re: Ubuntu Dapper Install howto

brightidea:

move zencart to /var/www (sudo mv * /var/www) (or have this in a sub-directory - your site, your call)
cd /var/www

Probably not the wisest of ideas, the Breezy->Dapper upgrade path had a post-install issue (technically not a bug that should happen all the time, but one can't be too careful) that overwrote the /var/www/ directory instead of /var/www/apache2-default one, nuking whatever was in the parent directory automatically.

A better solution might be to make a copy of /etc/apache2/sites-available/default, call it zencart and then modify it to point to the actual directory instead, then just change the symlinks in sites-enabled/ and reload apache.

Nice work otherwise, by the way.

Paul

21 Aug 2006, 7:39 AM
#4
brightidea avatar

brightidea

New Zenner

Join Date:
Aug 2006
Posts:
18
Plugin Contributions:
0

Re: Ubuntu Dapper Install howto

Hi,

Thanks for your replies, i will re-go over the documentation and edit acordingly.

I had a play around with zencart this weekend, it looks really good.

Is there any zencart hosting solutions in the UK?

Alan

21 Aug 2006, 7:42 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Ubuntu Dapper Install howto

there is one UK host on the Certified Hosts page (see link at top of this page).

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.