Sometimes, I have new domains/ sub domains and want to have their log file individually. How to set Apache to accept new virtual host without restarting the service?
I suppose graceful restart is the closest thing you can get. It will finish current requests and start with new config afterwards. ---- Logs Apache is usually set to record messages in the error_log and the access_log files located in /var/log/httpd. However, you may want each virtual host to have its own logs. Add the following to a vhost block to change its log settings: ErrorLog /var/log/httpd/client_a-error_log common CustomLog /var/log/httpd/client_a-access_log commonOf course, you'll have to create the new log files, too. They're plain text files and can be created with the touch command: touch /var/log/httpd/client_a-error_logBe sure to change the permissions and ownership appropriately. Depending on your configuration, these commands may resemble: % chmod 644 client* % chown apache:apache client*
Yep, he's right ^^, the command you're likely looking for is: 'apachectl graceful' - although you may want to test if it will work by running 'apachectl configtest' beforehand. (On some machines this is named apache2ctl, for apache 2.x trees). Good luck!