Apache: Load Vhosts From MySQL Database
Jun 21, 2008
if it was possible to load vhosts from a MySQL database and the only solutions i found didnt work for me. Im running Apache on Windows. Has anyone seen anything that would work with Windows? The only alternative i can think of is to read the database info using PHP and output it to a vhosts config file. I dont want to do that though because it means restarting the server to load the new config and i hear that a lot of vhosts slows the server down
View 4 Replies
ADVERTISEMENT
Nov 13, 2007
I've been having some trouble with Apache 2.0 recently. Whenever I load somewhere between 200 and 230 virtual hosts into Apache's config (as per my hosting control panel), Apache will fail to restart when the command "apache2ctl restart" is run. The command "/etc/init.d/apache2 restart" fails as well. All it does is signal all child processes of Apache to be terminated and fail to start again.
Here's what the log has to say:
Code:
[Tue Nov 13 19:04:18 2007] [notice] SIGHUP received. Attempting to restart
[Tue Nov 13 19:04:18 2007] [notice] seg fault or similar nasty error detected in the parent process
Is it that Apache is too bloated with vhosts to restart or is it something else?
FYI, I'm running Debian 3.1 (Sarge).
View 10 Replies
View Related
Mar 25, 2007
Either Apache 2.2 can't handle vhosts or I don't get apache anymore.
Have a look at the conf files (I stripped out all the commented lines):
httpd.conf
Code:
ServerRoot "/usr/local/apache2"
Listen 80
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbd_module modules/mod_authn_dbd.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule dbd_module modules/mod_dbd.so
LoadModule dumpio_module modules/mod_dumpio.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule include_module modules/mod_include.so
LoadModule filter_module modules/mod_filter.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule ident_module modules/mod_ident.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module modules/libphp5.so
<IfModule !mpm_netware_module>
User apache
Group apache
</IfModule>
ServerAdmin you@example.com
DocumentRoot "/usr/local/apache2/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "/usr/local/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
<FilesMatch "^.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
ErrorLog logs/error_log
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O" combinedio
</IfModule>
CustomLog logs/access_log common
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "/usr/local/apache2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
</IfModule>
Include conf/extra/httpd-vhosts.conf
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
httpd-vhosts.conf
Code:
NameVirtualHost *:80
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin cs@reflexnetworks.net
DocumentRoot /home/reflextest/public_html
<Directory "/home/reflextest/public_html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ServerName test.reflexnetworks.net
ServerAlias www.test.reflexnetworks.net
ErrorLog logs/test.reflexnetworks.net-error_log
CustomLog logs/test.reflexnetworks.net-access_log common
</VirtualHost>
( xxx.xxx.xxx.xxx is the correct IP). The <Directory "/home/reflextest/public_html">...</Directory> part does not make any difference
Permissions:
Code:
ls -lR reflextest/
reflextest/:
total 4
drwxr-xr-x 2 reflextest apache 4096 Mar 25 04:50 public_html
reflextest/public_html:
total 4
-rw-r--r-- 1 reflextest apache 22 Mar 25 04:50 index.html
This is a source compile of apache. See for yourself: [url]
View 4 Replies
View Related
Mar 15, 2013
I work for a start up as well as do independent consulting. I had a friend set up my apache server initially for the start up. It's been running fine. Now I want to host a client's site on the same server. I tired just adding a vhost section at the bottom of the conf file, but it said that I was running two sites off the same port. I tried manipulating the stuff my buddy did for me for the first site, then putting two vhosts on the bottom, but that just didn't work.
View 5 Replies
View Related
Apr 21, 2015
when I had multiple (at least 5) vhosts set to Apache when it just hanged, this was fixed adding:
Code:
Acceptfilter http none
Acceptfilter https none
To my httpd.conf, but now it's not hanging, it just times out, I get no error, nothing in the error.log file, it just times out.
After doing a refresh, it comes back like nothing happened.
View 13 Replies
View Related
May 29, 2007
I currently have one server a
Dual Xeon 5130 2GHZ (woodcrest)
2GB Ram.
Running cPanel/WHM
Now I run a website that is VERY PHP & MySQL Intensive and MySQL is ALWAYS the top of the process list, hogging a ton of usage. It's getting to the point where the site is needed a second server and I know there's a few options; but I'm not sure which one would be the best.
They way I see it my two options are getting a 2nd server and setting up the two to do load balancing, or getting a 2nd server and setting one up for just Apache and the Other for MySQL and using the 2nd as a remote SQL server.
If I do the Apache on a seperate server would I need such a powerful server? And if I also would want to upgrade this server along with getting a 2nd server would I be better of upgrading to 4GB of RAM or upgrading the processors?
View 9 Replies
View Related
Aug 29, 2013
I'm trying to configure a host to use vhosts but the server keeps breaking when I uncomment the Include vhosts file line. The apache process starts but none of the hostnames work. When the line is commented out, only the main hostname (defined in httpd.conf) works.
View 1 Replies
View Related
Mar 15, 2013
I've just built a new LAMP server and I'm having a little issue where Apache doesn't serve a simple non-database webpage, instead, I get an error on all my virtual-host in the browser: Database Error: Unable to connect to the Database: Could not connect to MySQL.
I've googled the problem but since the error mentions MySql, everything I find is related to connecting to MySql, which I'm not trying to connect... and I've contacted my Linux mentor about this issue... This is something I've never seen before... don't know why Apache thinks I'm trying connect to MySQL on every browser call to the server...
However, MySQL is accessible via telnet, and all my permissions are correct...
View 1 Replies
View Related
Dec 7, 2008
Don't know if it is some kind of attack or this is normal but the Server load goes reaching 20 in most of the times and may be greater!
this is the mysql_process list
jarabhar_JUHyyuh is opening alot of connections in the same time and this is not the normal behavior ....
View 2 Replies
View Related
Mar 31, 2008
We have setup and are currently testing a load balanced cluster using heartbeat and ldirectord. One of the problems we have come across is that we are unable to reliably use the same web server for connections from the same user. As a result the php sessions are getting in a bit of a muddle.
Obviously its not something that we can easily sync between servers like the customers other web content. We are looking at either storing the sessions in a database or NFS.
The site is pretty busy and we are a bit worried that when the site goes live both these options will slow everything down.
Apart from using different load balancing software is there any other solutions we could use for this? Has anyone stored php sessions in a database on a busy site or on a NFS?
View 3 Replies
View Related
Aug 23, 2007
I am just a beginner and it is about a month that the mysql loads on my server is so high , I have checked the mysql processlist via cpanel and there is no account that takes high mysql and make it high , and even I have checked for any possible rotten databases. but still the server load is so high and I can not control it , even when I restart it just after a minute it goes up again.
just the spamd command takes a high CPU usage sometimes. what it should be from? the spamd for a special account!
I need to optimize mysql , and need help. please do not tell me to hire an expert , just help me thanks
and another question is that how can I check which account is sending spam and stop it?
View 14 Replies
View Related
Mar 11, 2008
I have a dual xeon server that host around 15 small website, but these days I see that the load generated from mysql is very high as you can see below is consumes 32.6 CPU
mysql 32.60 1.20 0.0
how I can know what is the cause of this load?
View 11 Replies
View Related
Feb 15, 2007
MySQL.
Quote:
top - 18:43:24 up 18 days, 18:05, 1 user, load average: 145.13, 92.77, 40.84
Tasks: 145 total, 10 running, 134 sleeping, 0 stopped, 1 zombie
Cpu(s): 28.7% us, 70.6% sy, 0.0% ni, 0.0% id, 0.7% wa, 0.1% hi, 0.0% si
Mem: 1034060k total, 605968k used, 428092k free, 21400k buffers
Swap: 1020088k total, 165076k used, 855012k free, 119448k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6102 mysql 16 0 343m 146m 2868 S 364 14.5 1441:52 mysqld
My server almost went dead... until I rebooted MySQL.
View 7 Replies
View Related
Oct 17, 2007
MySql die with high load problem?
My server running: Server Load124.40 (2 cpus)[url] Memory Used70 %[url]
Server info:
Processor #1 Vendor: GenuineIntel
Processor #1 Name: Intel(R) Xeon(R) CPU 3060 @ 2.40GHz
Processor #1 speed: 2394.840 MHz
Processor #1 cache size: 4096 KB
Processor #2 Vendor: GenuineIntel
Processor #2 Name: Intel(R) Xeon(R) CPU 3060 @ 2.40GHz
Processor #2 speed: 2394.840 MHz
Processor #2 cache size: 4096 KB
Memory Information Memory: 4148800k/4718592k available (1883k kernel code, 43336k reserved, 761k data, 188k init, 3275648k highmem)
View 9 Replies
View Related
Feb 11, 2007
i'm using Vista RTM, and so then
my PHP module can load mysql 5.0.27.
Apache version: 2.0.55 ( ok )
PHP version: 5.2.0 ( unzip package - ok)
MySQL version: 5.0.27 ( connection is ok only with cmd line )
so, what's the problem.
i tried with this solution:
[url]
but it's take no effect.
what's the step i have been lost?
View 2 Replies
View Related
Sep 4, 2007
when mysql has heavy load average what else can be done rather than restarting mysql service.
View 6 Replies
View Related
Jan 8, 2007
There is a problem with mysql and server load. Some how mysql usage is going to over 100, but server load is not increasing, but it is crashing more often.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5931 mysql 16 0 111m 20m 3888 S 71 2.1 10488:45 /usr/sbin/mysqld --basedir=/ --datadir=/var
What could cause the problem? I did mysqladmin pr and only 2 database connections are existing.
View 4 Replies
View Related
May 11, 2008
i been trying to move my server.. But mysql database is quite big and restoring takes ages 10 12 hours.. is there anyway i can make it quick because database dump takes 10 15mins but restore takes 12hours and it should be a way to make that quick
View 14 Replies
View Related
Nov 16, 2007
I tried searching the forums a bit and the Apache manual, but I was unable to find much related to my specific problem.
We have a system such that each user has a 'www' folder in their home directory so that example.com/~user will point to that folder. The user information, however, is not on the www server and instead we use a network file system to access the files in the home folder.
This all works fine and dandy with mod_rewrite. However, we want to allow each user to have access to the error logs, etc. for their own site. The best way to do this seems to simply store it in their home directory.
The problem is that how do you split these files apart. While it would be possible to have a separate process do it, the best way seems to just have each user be their own vhost. mod_vhost_alias seems to be applicable in this situation.
However, mod_vhost_alias relies on either the Host: field or the ip to split queries into their respective vhosts. As said before, our system uses the directory.
So the question is, is there a way to either use mod_rewrite to tell mod_vhost_alias what the vhost's name is. Or, is there a way to split the logs another way.
View 0 Replies
View Related
Mar 14, 2008
it was very fast until mysql upgraded to 5.0.45 it was 4.. i can’t even turn my forum if it is a busy time cos it is so slow i get page not found after a while but when it is quiet it is not too bad... but it was alot more faster with mysql 4 i don't really want to downgrade please give me some ideas to fix this issue ...........
View 3 Replies
View Related