services that are not necessary on a web server
Tue, 08/21/2007 - 15:45 — sandipThese are some services I would normally turn off on web servers.
NOTE: usage may vary.
- gpm -- mouse
- mdmonitor -- monitor raid devices
- netfs -- nfs, samba etc...
- autofs -- automount, nfs, cd etc...
- kudzu -- detect new hardware
- restorecond -- monitor selinux file context
- mcstrans -- mandatory access control selinux translation
- messagebus -- routes messages between applications
- haldaemon -- maintains database of devices connected
There may be more, but if you've cleaned up your rpm packages, it would probably not exist.
- sandip's blog
- Login or register to post comments
- Read more
rpm packages not necessary for a web server
Tue, 08/21/2007 - 15:37 — sandipBelow is a list of rpm packages that are not necessary on a web server. Use it as a reference starting point for cleaning up servers. You may also want to make sure not to run services not required by the server.
NOTE: usage may vary and removal should be in the order listed:
-
redhat-lsb cups system-config-printer-libs system-config-printer paps -- printer support
-
system-config-soundcard -- gui for sound setup
-
system-config-securitylevel-tu
i -- gui for setting up security
-
nfs-utils system-config-nfs nfs-utils-lib -- nfs server
- portmap -- manage RPC connections
- ypbind yp-tools -- NIS client binding
-
htmlview -- view webpages via gui
-
system-config-services system-config-samba pinfo system-config-users system-config-date -- gui configs
-
samba samba-client samba-common -- samba support
- oprofile oprofile-devel oprofile-gui qt
- vnc
-
libglade2 libgnomecanvas usermode-gtk libbonoboui libgnomeui libglade-java pygtk2-libglade system-config-httpd system-config-network gnome-mount libgnome-java gnome-python2-bonobo gnome-python2-canvas gnome-python2 authconfig-gtk system-config-lvm authconfig-gtk pirut gnome-vfs2 gnome-python2-gnomevfs gnome-python2-gconf libgnome libgsf librsvg2 librsvg2
ImageMagick -
gnome-mime-data gnome-keyring notify-python
- GConf2 notification-daemon bluez-gnome libgconf-java libnotify bluez-utils
- libgtk-java libvte-java
- pygtk2 system-config-language system-config-rootpassword
- vte
- libwnck
- glib-java cairo-java frysk
- libwmf
- gtk2
-
cups-libs
-
ghostscript ghostscript-fonts
- avahi avahi-glib
- wpa_supplicant NetworkManager
- system-config-rootpassword
-
system-config-language
- system-config-keyboard
- system-config-network-tui firstboot-tui
-
system-config-securitylevel-tu
i -
dhcpv6_client dhcdbd dhclient -- dhcp support
- irda-utils -- Infra Red communications
- isdn4k-utils -- ISDN
- apmd -- laptop power management
- cpuspeed -- dynamically changing cpu speed
- bluez-libs -- bluetooth
- irqbalance -- irq load balancing on multi-cpus (remove only in single cpu situation)
- rsh -- unsecure remote access
- talk -- internet talk protocol
- foomatic -- printer driver database
- finger -- finger client
- eject -- eject removable media
-
cvs -- concurrent version control
- rcs -- revision control system
- dosfstools mkbootdisk -- bootdisk
- redhat-menus desktop-file-utils startup-notification -- desktop
- ppp rp-pppoe wvdial -- dialup
- esound -- sound daemon
- pcmciautils -- PCMCIA Cardbus
- pcsc-lite coolkey ifd-egate ccid
- OpenIPMI net-snmp-libs
- ImageMagick-devel -- ImageMagick development package xorg-x11-devel -- X server development package
- acpid -- power management (remove if you don't shutdown using power button)
logging php errors on godaddy hosting
Fri, 07/20/2007 - 12:41 — sandipGodaddys' linux hosting allows for editing your own "php.ini" file and enables support for logging errors, good for debugging purposes when developing with php.
Add the below lines to php.ini in the document root, to log all errors:
error_reporting = E_ALL
log_errors = on
error_log = /home/content/p/a/t/pathto/htm l/error_log
You should also protect the php.ini and error_log file via .htaccess:
<FilesMatch "(error_log|php\.ini)$&qu ot;>
Order deny,allow
Deny from all
</FilesMatch>
- sandip's blog
- Login or register to post comments
Build PHP with Freetype on DirectAdmin
Mon, 07/02/2007 - 11:04 — sandipEasy way to add freetype support on PHP, on a DirectAdmin hosting environment with Fedora as the OS, is to use the rpm versions of freetype and freetype-devel.
-
If not installed already:
# yum install freetype freetype-devel
Edit "/usr/local/directadmin/custom
--with-freetype \
&nbs p; --with-freetype-dir=/usr/lib \
&nbs p; --enable-gd-native-ttf \
Note: /usr/lib is the path to the libttf.so .
# rpm -ql freetype-devel | grep libttf.so
Then run the build:
# ./build clean
# ./build php n
If you need to build and update existing packages:
# ./build clean
# ./build update
# ./build all
Check with phpinfo to confirm.
Installing Bugzilla on an ISPConfig site
Thu, 06/07/2007 - 16:34 — sandipThese are some notes I had taken down during the installation of Bugzilla on a server with ISPConfig hosting control panel:
Requirements:
# yum install mysql-devel gd-devel libpng-devel libjpeg-devel freetype-devel libdbm-devel
# rpm -e mod_perl #else mod_perl2 does not install.
Create Site:
Site was created via the ISPConfig control panel with "web6_bugs" as the admin user and "web6" as the group.
Install:
$ cd /var/www/web6
$ wget http://ftp.mozilla.org/pub/moz illa.org/webtools/bugzilla-3.0 .tar.gz
$ tar -xvzf buzilla-3.0.tar.gz
$ mv buzilla-3.0/* web
$ ./checksetup.pl --check-modules
# perl -MCPAN -e 'install AppConfig' #had to force install.
# perl -MCPAN -e 'install Bundle::Bugzilla'
# perl -MCPAN -e 'install GD' #requires libpng-devel, libjpeg-devel, freetype-devel
$ ./checksetup.pl #Edit the localcofig with the correct database settings.
$ ./checksetup.pl #Re-run anytime if needed, specifically if the file permissions are not correct.
$ chgrp -R apache . #Had to make all files belong to the apache group after re-running checksetup.pl .
Apache with mod_perl need the below directives in httpd.conf:
PerlSwitches -I/var/www/web6/web -w -T
PerlConfigRequire /var/www/web6/web/mod_perl.pl
Runs a lot faster, but is a memory hog. Suggested to turn off KeepAlive in apache when running mod_perl.
Crontab Entry:
# Bugzilla
5 0 * * * web6_bugs cd /var/www/web6/web; ./collectstats.pl
55 0 * * * web6_bugs cd /var/www/web6/web; ./whineatnews.pl
*/45 * * * * web6_bugs cd /var/www/web6/web; ./whine.pl
- sandip's blog
- Login or register to post comments
- Read more
Hosting multiple domains pointed to the same web-space
Thu, 05/31/2007 - 16:20 — sandipPlace the snippet of code in an index.php file to pull up a different web page for each domain pointed to the same web-space.
<?
$serverName = $HTTP_HOST;
$serverName = str_replace("www.",& quot;",$serverName);
$serverName = str_replace(".com",& quot;",$serverName);
$serverName = str_replace(".net",& quot;",$serverName);
$serverName = str_replace(".org",& quot;",$serverName);
if (!(empty($serverName))) {
include("./".$server Name.".html");
}
?>
Enabling quotas for users
Fri, 03/23/2007 - 10:58 — sandipCheck to make sure the quota package is installed, else run:
# yum install quota
Edit "/etc/fstab" and add "usrquota,grpquota" to the / partition:
LABEL=/ / ext3 defaults,usrquota,grpquota&nbs p; 1 1
Then run:
# mount -o remount /
# quotacheck -avugm
# quotaon -avugm
To check quotas for all users:
# repquota -a
To edit quota for a particular user:
# edquota -u <user>
Alternately use setquota:
# setquota <softlimit> <hardlimit> 0 0 <user>
- sandip's blog
- Login or register to post comments
New Hosting Server Checklist
Tue, 02/20/2007 - 11:20 — sandipBelow are some basic guidelines on setting up new hosting servers. This is only a point of reference to begin with and you should know what you are doing, else it is highly advisable to get an expert to work on setting up and securing the server:
Synopsis:
-
Scan server with tools such as netstat, nmap, nessus etc...
Disable services not required.
Remove packages not required.
Update all other packages.
Secure Incoming and Outgoing ports.
Move SSH to a different port and disable direct root login.
Enable Antidos and BruteForce Detection.
Scan for rootkits and setup daily reporting.
Secure tmp and tmpfs.
Secure binaries, paths and profiles.
Secure Apache and PHP, and cofigure to expose minimum info about the applications used.
Secure Ftp via TLS/SSL connection.
...
- sandip's blog
- Login or register to post comments
- Read more
Migrating sites between DirectAdmin servers
Fri, 02/02/2007 - 10:55 — sandipThese are some basic notes for reference just in case I need to do the migration thing again!!!
Steps taken on the old server
-
Created a new reseller account.
Created sites in the new reseller account as domain.com2 for the domains that needed to be migrated. DA won't let you add the same name twice, which is why I used a different one for the time being. Doing this will setup all the required files/paths needed to use the website.
Copied the files to the new domain.
# cp -pR /home/olduser/domains/domain.c om/* /home/newuser/domains/domain.c om2/
# chown -R newuser:newuser /home/newuser/domains/domain.c om2
# for x in `find /home/newuser/domains/*/public _html -type f -print0 | xargs --null grep -l /home/olduser`; do perl -pi.bak -e 's/\/home\/olduser/\/home \/newuser/g' $x ; done
# cd /etc/virtual
# mv domain.com domain.com.tmp
# mv domain.com2 domain.com
# mv domain.com.tmp domain.com2
Changed user for the imap files.
# find /home/newuser/imap -user olduser | xargs chown newuser:newuser
Renamed the new domains to domain.com from domain.com2.
Logged in as reseller and created a backup.
Created a script and dumped out single databases.
#!/bin/bash
# dbExport.sh
OLD_DB=(
db1
db2
db3
...
)
for ((i=0; i<${#OLD_DB[@]}; i++))
do
mysqldump --opt -u root --password={psswd} ${OLD_DB[$i]} > ./db/${OLD_DB[$i]}.db
done
# find /home/newuser/domains -perm 0777 -type d > 777.txt
Types of Web Hosting Service
Wed, 12/13/2006 - 12:14 — wizap-
Free web hosting service: is free, (sometimes) advertisement-supported web hosting, and is extremely limited when compared to paid hosting.
Shared web hosting service: one's Web site is placed on the same server as many other sites, ranging from a few to hundreds or thousands. Typically, all domains may share a common pool of server resources, such as RAM and the CPU.
Reseller web hosting: allows clients to become web hosts themselves. Resellers could function, for individual domains, under any combination of these listed types of hosting, depending on who they are affiliated with as a provider.
Virtual Dedicated Server: slicing up a server into virtual servers. each user feels like they're on their own dedicated server, but they're actually sharing a server with many other users.
Dedicated hosting service: the user gets his or her own Web server and gains full control over it (root access for Linux/administrator access for Windows); however, the user typically does not own the server.
Colocation web hosting service: similar to the dedicated web hosting service, but the user owns the server; the hosting company provides physical space that the server takes up and takes care of the server. This is the most powerful and expensive type of the web hosting service. In most cases, the colocation provider may provide little to no support directly for their client's machine, providing only the electrical, Internet access, and storage facilities for the server.
Clustered hosting: having multiple servers hosting the same content for better resource utilization.