Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject:
PostPosted: Fri Jan 30, 2009 2:21 am 
Offline
Newbie

Joined: Fri Jan 30, 2009 1:58 am
Posts: 3
maybe a little off topic. This page is about Nginx, mysql, php and wordpress

http://www.mensk.com/webmaster-toolbox/ ... wordpress/

I post this page because I think it's a complete guide on an application (WordPress) setup, so it's very helpful for newcomers. And, one day, you may be interested in Nginx :-)

please be noted, this page is written for SliceHost, but really it can be used on any Ubuntu server.


Top
   
 Post subject:
PostPosted: Fri Jan 30, 2009 4:54 am 
Offline
Senior Newbie

Joined: Mon Nov 10, 2008 4:56 am
Posts: 8
zhouxiaohu wrote:
maybe a little off topic. This page is about Nginx, mysql, php and wordpress

http://www.mensk.com/webmaster-toolbox/ ... wordpress/

I post this page because I think it's a complete guide on an application (WordPress) setup, so it's very helpful for newcomers. And, one day, you may be interested in Nginx :-)

please be noted, this page is written for SliceHost, but really it can be used on any Ubuntu server.


To add some extra confusion, in my signature there's a guide for Lighttpd instead of Apache and nginx, in combination with PHP/MySQL and mail via Google apps for domain (with msmtp)

_________________
Setup the ultimate Ubuntu/Lighttpd/PHP/MySQL server, and keep it running: http://nanotux.com/blog/the-ultimate-server/


Top
   
 Post subject:
PostPosted: Sun Feb 01, 2009 1:39 am 
Offline
Newbie

Joined: Sun Feb 01, 2009 1:12 am
Posts: 4
Seemed appropriate to ask questions in this ongoing thread. I'm setting up a web server so I can ultimately transfer my site there. I used the perfect server guide found at the beginning of this thread on a clean install of Ubuntu 8.10. Before I jump to the end, some notes on the process:

(1) I began with step 8.

(2) AppArmor did not seem to be installed by default.

(3) Step 15 asks you to telnet to test an install. My results differed slightly:
Code:
250-AUTH PLAIN NTLM LOGIN DIGEST-MD5 CRAM-MD5

instead of
Code:
250-AUTH PLAIN LOGIN


(4) phpMyAdmin was not included in guide, but I installed it before step 22 (ISPConfig installation). At this point, the phpMyAdmin index page would show text (due to php being disabled globally I assume) and visiting the site would display "It works!" or some variation of.

(5) The installation of ISPConfig 3 seemed to duplicate a lot of the packages I had already installed following the guide. I left those out. I did not install suPHP.

(6) During the installation of ISPConfig I landed at this prompt:
Quote:
ISPConfig Port [8080]:

Without finding any further instructions I quit and was greeted with:
Quote:
Installation terminated by user.

This was not my intention. If there's further configuration to do I'm unsure how to go about it.

(7) I made the Apache fixes as instructed for ISPConfig, then uncommented the lines in /etc/mime.types for PHP, assuming this would let me run php files (such as phpmyadmin). However... things appear to be fubar'd. I get a nice 404 visiting the site now, and restarting Apache gives me this warning:
Quote:
[warn]NameVirtualHost *:80 has no VirtualHosts



Is the installation salvageable, or do I start from scratch? Any help is appreciated.


Top
   
 Post subject:
PostPosted: Tue Feb 03, 2009 1:58 pm 
Offline
Senior Newbie

Joined: Wed Sep 24, 2008 6:38 pm
Posts: 19
Quote:
Correct me if I am wrong do I need to install apache server on ubuntu server or does ubuntu server comes with apache?

You might want to install lighttpd instead of apache, depending on how much memory your linode account has, as it uses less RAM.

Steps
1. Firewall
Code:
# apt-get install arno-iptables-firewall

The installation will prompt you for the ports to enabled. Ports you may want to enable:
  • 7 echo (for ping)
  • 22 ssh
  • 25 smtp
  • 80 http
  • 110 pop3
  • 143 Imap
  • 443 https
  • 993 Imap over ssl/tls
  • 995 pop3 over ssl/tls
  • 3306 mysql
2. Create a script, say, ~/firewall-stop to flush all iptables rules (just in case you need it).
Code:
#!/bin/bash 
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

Code:
# sudo chmod u+x ~/firewall-stop

You can execute it
Code:
# sudo ~/firewall-stop

if you get locked out, from the linode console java applet (without needing to ssh).
3. Install lighttpd
Code:
# aptitude install lighttpd 

4. Either create a file uploads directory for lighttpd or set upload_tmp_dir in php.ini and create the directory, setting the group to www-data (chgrp) and setting the permissions appropriately. This step is not needed as of lighttpd 1.4.19 and above.
Code:
# mkdir /var/cache/lighttpd/uploads 
# chgrp –R www-data /var/cache/lighttpd/uploads
# chmod g+rw /var/cache/lighttpd/uploads


5. Enable fastcig and auth modules
Code:
# lighty-enable-mod fastcgi auth 

6. Install php and phpmyadmin
Code:
# aptitude install php-cgi php5-cli php-db php-pear php5-gd php5-mcrypt php5-mysql php5-xcache phpmyadmin

7. Create the ‘recommended’ php.ini
Code:
# cp /usr/share/doc/php5-common/examples/php.ini-recommended /etc/php5/cgi/php.ini 

8. Configure fast-cgi
Code:
fastcgi.server = 
(
 ".php" =>  ((    "bin-path" => "/usr/bin/php-cgi -c /etc/php5/cgi/php.ini",
   "socket" => "/tmp/php.socket",
   "max-procs" => 1,
   "idle-timeout" => 20,
   "bin-environment" => ( "PHP_FCGI_CHILDREN" => "4", "PHP_FCGI_MAX_REQUESTS" => "10000" ),
"bin-copy-environment" => ( "PATH", "SHELL", "USER" ),
"broken-scriptfilename" => "enable"
 ))
)

See Lighttpd and PHP configuration for more information. max-procs = 1 is recommended is using an php op code cacher.

9. Install php op code cacher xcache.
Code:
# aptitude install  php5-xcache

Encrypt and set the password for the administration page for xcache. See How to Install XCache Administration Page. You need to encrypt your xcache admin password by creating and running this php script:
Code:
<?php
echo md5("password");
?>
substituting your actuall password for "password". Then edit /etc/php5/conf.d/xcache.ini and change the lines
Code:
xcache.admin.user = "mOo"
xcache.admin.pass = "5f4dcc3b5aa765d61d8327deb882cf99"
using a user name of your choice and the encrypted password generate from the script above.

10. Set up any virtual hosts for lighttpd (If you have many, then you would want to either enable simple_vhost or use the built-in evhost.path-pattern setting in /etc/lighttpd/lighttpd.conf).

Sampe virtual hosts
Code:
# sudo nano /etc/lighttpd/lighttpd.conf

Code:
$HTTP["host"] =~ "^(www\.)?sampledomain1.com$" {
 server.document-root = "/usr/share/phpgedview/"
}

$HTTP["host"] =~ "^(www\.)?someblog.com$" {
 server.document-root = "/usr/share/wordpress/"
}

$HTTP["host"] =~ "^(www\.)?sampledomain3.com$" {
   server.document-root = "/var/www/sampledomain3.com/"
}

# /etc/init.d/lighttpd force-reload.

=~ signifies a regular expresssion syntax is being used.
Include any aliases in a separate file.
Code:
# sudo nano /etc/lighttpd/myconf.conf
alias.url += ( "/xcache-admin" => "/usr/share/xcache/admin",
"/aptitude" => "/usr/share/doc/aptitude/html/en",
"/apt-doc" => "/usr/share/doc/apt-doc")

Edit /etc/lighttpd/lighttpd.conf and add the line
Code:
include "myconf.conf"
after the virtual host entries.
11. Set up users and password for any password-protected lighttpd directories. See this guide: Lighttpd setup a password protected directory
12. restart lighttpd
Code:
# /etc/init.d/lighttpd restart 


Top
   
 Post subject:
PostPosted: Wed Feb 04, 2009 11:34 pm 
Offline
Newbie

Joined: Sun Feb 01, 2009 1:12 am
Posts: 4
Following up on my previous post: I blanked out my installation and started from scratch. I installed ISPConfig 2 and was able to login without problems. I updated the e-mail address to my own from the default root@localhost then logged out. I installed phpMyAdmin only to find out I could no longer connect to ISPConfig. I uncommented PHP in /etc/mime.types and in /etc/apache2/mods-enabled/php5.conf (as per the Perfect Server guide) which gets phpMyAdmin working, but still no luck with ISPConfig. Any ideas what I may have missed?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group