Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Dec 02, 2008 8:50 pm 
Offline
Junior Member

Joined: Tue Dec 02, 2008 8:24 pm
Posts: 22
Website: http://www.iheartlinux.com
Location: Pennsylvania
An Apache install is easy:

apt-get install apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert

done!

Now that we have Apache installed, we can move onto installing PHP. If you don’t require PHP then please feel free to skip.

PHP5 Install

In this example, I’m not going to install all the modules available. Just some common ones.

To see what modules are available try a:

apt-get search php5-

Note the ‘-’ at the end of ‘php5′. This will show any packages that start with ‘php5-’ and shows the available modules.

Due to using apt-get to install PHP5, any dependencies are taken care of:

This will install php with mysql support:

apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd \
php5-imagick php5-mcrypt php5-memcache php5-mhash php5-mysql php5-pspell php5-snmp \
php5-sqlite php5-xml php5-xsl

Once done, do a quick Apache reload:

/etc/init.d/apache2 reload

Done!


Top
   
PostPosted: Tue Dec 02, 2008 10:19 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Nice and quick tutorial, thank you.
Just a couple of corrections:

routermods wrote:
apt-get search php5-

That should be apt-cache search php5-

routermods wrote:
php5-xml

That should be php5-xmlrpc

And unless you'll be connecting to an external MySQL server, it's probably a good idea to include apt-get install mysql-server mysql-client in your tutorial as well. Most newbies are going to need it anyway. Perhaps even apt-get install phpmyadmin (but only if you want to keep your web root at /var/www, because that's where Ubuntu installs phpmyadmin by default.)


Top
   
 Post subject: phpmyadmin
PostPosted: Wed Dec 03, 2008 9:57 am 
Offline
Junior Member

Joined: Tue Dec 02, 2008 8:24 pm
Posts: 22
Website: http://www.iheartlinux.com
Location: Pennsylvania
If you include the following in your apache2.conf you can overcome the problem of placing it in your /var/www:


# phpMyAdmin default Apache configuration
Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
Options Indexes FollowSymLinks
DirectoryIndex index.php
# Authorize for setup
<Files setup.php>
# For Apache 1.3 and 2.0
<IfModule mod_auth.c>
AuthType Basic
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.setup
</IfModule>
# For Apache 2.2
<IfModule mod_authn_file.c>
AuthType Basic
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.setup
</IfModule>
Require valid-user
</Files>
<IfModule mod_php4.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IfModule>
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IfModule>
</Directory>

I do however suggest changing the alias from phpmyadmin to anything else.....(security)


Top
   
 Post subject:
PostPosted: Wed Dec 03, 2008 1:57 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2008 3:40 pm
Posts: 109
There's also PEAR, which provides some really useful tools.
Install it with
Code:
sudo apt-get install php-pear
If you don't like binaries, you can always get the latest version of the PEAR extensions here and compile it yourself.


Top
   
 Post subject:
PostPosted: Wed Dec 03, 2008 2:01 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2008 3:40 pm
Posts: 109
One more thing, if you are running anything more than a simple, low-traffic site you should consider caching. I prefer APC (Alternative PHP cache). APC comes with PECL, the sister of the PEAR I've mentioned above.
After installing PECL, you can install APC with
Code:
sudo pecl install apc


Top
   
PostPosted: Wed Dec 03, 2008 2:36 pm 
Offline
Junior Member

Joined: Tue Dec 02, 2008 8:24 pm
Posts: 22
Website: http://www.iheartlinux.com
Location: Pennsylvania
My site http://www.routermods.com it is a blog, I take modest traffic how much would caching speed up wp (wordpress)......also what would it affect: posttime, etc.......can you specify caching time like in ASP or .net?


Top
   
 Post subject:
PostPosted: Wed Dec 03, 2008 3:04 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2008 3:40 pm
Posts: 109
I have never used asp or .net but I guess (I haven't tested it myself) the posting time shouldn't be affected with a properly configured APC.


Top
   
 Post subject: erhm?
PostPosted: Wed Dec 03, 2008 3:29 pm 
Offline
Junior Member

Joined: Tue Dec 02, 2008 8:24 pm
Posts: 22
Website: http://www.iheartlinux.com
Location: Pennsylvania
hrlo

_________________
Image


Top
   
 Post subject: wait>?
PostPosted: Wed Dec 03, 2008 3:29 pm 
Offline
Junior Member

Joined: Tue Dec 02, 2008 8:24 pm
Posts: 22
Website: http://www.iheartlinux.com
Location: Pennsylvania
So can you configure the caching time?

_________________
Image


Top
   
 Post subject:
PostPosted: Wed Dec 03, 2008 3:34 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2008 3:40 pm
Posts: 109
Among other things, yes you can. You can read more about it here.


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


Who is online

Users browsing this forum: No registered users and 2 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