I am using free tier Amazon AWS EC2 micro instance and hosting a Wordpress site. As the memory is too low, I always get common error like "Error Establishing to Database", and from the log I can see that the http process takes the memory.This causes the web service to be stopped.
I have tuned my MySQL config file and now I like to tune up the http configuration. I like to apply the things below in my httpd.conf
Timeout 30
KeepAlive On
MaxKeepAliveRequests 50
KeepAliveTimeout 10
<IfModule prefork.c>
StartServers 3
MinSpareServers 2
MaxSpareServers 5
MaxClients 10
MaxRequestsPerChild 1000
</IfModule>
But for some reason, I could not find the info above in the file. Do I need to add it manually? Is it in somewhere else? I have tried to find it in another folder but could not find anything. I am not a Linux guy by the way. I appreciate any guidance on this.
My Linux version is Amazon Linux AMI release 2016.03. Thanks.
Main configuration file:
- /etc/httpd/conf/httpd.conf
Other configuration loaded files:
- conf.modules.d/*.conf
- conf.d/*.conf
MPM Configuration file:
/etc/httpd/conf.modules.d/00-mpm.conf
You couldn't find the section cause Amazon uses the default configuration. Add your code in the end of this file:
<IfModule prefork.c>
StartServers 3
MinSpareServers 2
MaxSpareServers 5
ServerLimit 10
MaxClients 10
MaxRequestsPerChild 100
</IfModule>
and restart Apache server:
sudo service httpd restart
Source: https://www.pauloacosta.com/2019/09/onde-fica-o-arquivo-de-configuracao-do.html
Best thing for you would be to add your configuration file and monitor httpd after restart.
Related
please help me with the following problem:
I have a fresh installed Ubuntu Desktop 20.4 here and installed Apache2 from the ubuntu-repository.
For a test I disabled the 000-default.conf from the sites-enabled directory with a2dissite and removed the file 000-default.conf from the sites-available directory. "apachectl configtest" shows that the syntax is ok. "apachectl -S" shows, that there is no virtual host configuration. I have restarted the computer, but the Apache webserver still serves the standard Website. There are fresh entries in the "other_vhost_access.log". I wonder what configuration serves this website. I thought, when there is no conf-file enabled in "sites-enabled" apache doesn't serve any website?!
Where did I go wrong? Didn't find anything while searching. It's difficult to find the keywords.
Thanx for any help in advance.
Regards
Endi
Apache is serving as per config settings in the main configuration files apache2.conf or httpd.conf
I'm trying to install GitLab, but I want to install it on an Apache web server on my VPS.
I know that GitLab was built for nginx, but I honestly don't want to use it. I was wondering how I would be able to have a setup so that
mysite.com would retrieve the files (like index.html, folders with more files in them, etc.) in /var/www/html
lab.mysite.com would retrieve GitLab.
I've heard you're supposed to use a virtual host, but remember, I'm still an amateur at best with this kind of stuff, so if anyone here is kind enough to make a short step-by-step guide to do this, I'd appreciate this.
Note: Before I've been using this guide to install GitLab, however this is for Nginx, so I was wondering if I was to use this guide but then add onto it, or if I'm going about this all wrong.
By default GitLab will install nginx but usually won't add nginx to your system's service manager (service or systemctl). This makes it confusing when trying to enable Apache (Apache won't start due to default port 80 in use by nginx).
Assuming you've installed Gitlab according to the default install instructions, the Nginx service will now be managed by the gitlab-ctl service manager (which is installed when installed Gitlab).
To stop Nginx, run the following from a command line as root:
gitlab-ctl stop nginx
Now that port 80 is free, you can start Apache (don't forget to install Apache if it's not already / Instructions are for RHEL systems - modify accordingly for Ubuntu etc). Assumes you are root user:
yum install -y httpd;
systemctl start httpd;
systemctl enable httpd;
Let's edit the Gitlab config file to disable nginx and tell gitlab to use apache:
vi /etc/gitlab/gitlab.rb
Add either your domain or IP to the following:
external_url 'http://git.yourdomain.com/'
Find:
# web_server['external_users'] = []
Change to (don't forget to remove the leading '#'):
web_server['external_users'] = ['apache']
Find:
# nginx['enable'] = true
Change to:
nginx['enable'] = false
And finally we have to run a "recompile" with:
gitlab-ctl reconfigure
gitlab-ctl restart
Now the Apache config. When we installed Gitlab, it added a user group called gitlab-www. We need to allow the apache user access to that group. The following assumes you've installed apache and the user apache (48) exists:
To check which group gitlab installed itself under, you can run:
getent group
Now lets modify apache's user and add it to the gitlab-www group:
usermod apache --append --groups gitlab-www
Now we need an Apache Virtual Host to point to the gitlab install.
Add a virtual host to Apache's conf.d directory (this will create a new file):
vi /etc/httpd/conf.d/gitlab.conf
Add the following (tweak according to your needs):
<VirtualHost *:80>
ServerName git.yourdomain.com
ServerSignature Off
ProxyPreserveHost On
<Location />
Order deny,allow
Allow from all
ProxyPassReverse http://127.0.0.1:8080
ProxyPassReverse http://git.yourdomain.com/
</Location>
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
# needed for downloading attachments
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
ErrorLog /var/log/httpd/error_log
CustomLog /var/log/httpd/access_log combined env=!dontlog
</VirtualHost>
... And now restart Apache:
systemctl start httpd
You may run into issues with things like selinux - You can set things to permissive for debugging purposes.
setenforce 0
I hope this helps someone!
Error in the Logs is
Premature end of script headers: index.php, referer: http://www.example.com/index.php/install/wizard/config/?config%5Blocale%5D=en_US&config%5Btimezone%5D=America%2FLos_Angeles&config%5Bcurrency%5D=USD
Error shown in magento installation screen
Error log record number: 425991650051
Also i found that during installation only 86 tables were sucessfully added in the magento database.
phpinfo of the Server
display_errors On
max_execution_time 30
memory_limit 90M
safe_mode Off
cURL support enabled
PDO support enabled
Simplexml support enabled
mcrypt support enabled
hash support enabled
GD Support enabled
DOM/XML enabled
iconv support enabled
Soap Client enabled
Soap Server enabled
Mysql Server version: 5.1.56
PHP Version 5.3.13
Changes made in index.php
error_reporting(E_ALL);
ini_set('display_errors', 1);
Initially i thought it was due to memory_limit and max_execution_time, but i recreated this same scenario in my localhost and it worked sucessfully inspite of memory being limited to 90M and max exec time as 30
How to solve this issue?
have you try this
change the permissions on index.php to 644.
also changed the directories permission: app, var, media and app/etc to 755
I want to configure Apache2 and tomcat7 with mod_jk in Linux environment ..I want to know the steps ..Please help me to congure it...
Have you tried anything yourself?
http://tomcat.apache.org/connectors-doc/generic_howto/quick.html should get you going. But if you have not tried anything yet how can we help you then? Let use know if anything specific goes wrong, including error messages etc.
You have to configuration for the apache (i use CentOS). The first file is under /etc/httpd/conf/wokers.properties
# the name tomcat1 is variable
worker.list=tomcat1
# default ajp port on server.xml of tomcat
worker.tomcat1.port=8009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tocmat1.socket_timeout=200
worker.tomcat1.retries=1
The second file depends on whether global or want Customizing for a virtual host. The following example is based on a virtual host (/etc/httpd/conf/virtualhost.conf)
JkWorkersFile "/etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/jk.log
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkLogLevel info
# mount all under URI /
JkMount /* tomcat1
# umount /robots.txt, request goes to apache document root
JkMount /robots.txt tomcat1
I have a Drupal 7.15 site we are testing out, and when I provisioned everything I was able to use the module updater/installer through the web admin interface with no issues. Now I seem to get a 500 ISE every time I try to install or update a module (either through link or direct upload).
I do not see anything helpful in the system log or in apache's error log.
I can see when I provide a URL or file, the Drupal server does grab it, puts it in /tmp/update-cache/ as it should (I have Drupal config'ed to use /tmp in File System->Temporary Directory), and it extracts the tar.gz to /tmp/update-extraction/
The files never get moved over to sites/all/modules. Permissions are
drwxrwxr-x 27 apache webeditors 4096 Sep 12 09:43 modules
apache is a member of webeditors.
Any help is appreciated!
Propably you need to increase thr PHP Memory
The quick way:
add ini_set('memory_limit','256M'); to your settings.php
Universal way:
edit this limit in your php.ini. by finding
php_value memory_limit 32M and changing to appropriate limit
To find php.ini location run a phpinfo();