Skip to main content

Posts

Showing posts from June, 2018

ubuntu - non www to www domain?

I've changed my conf file so that when a user types in the domain without www it redirects to the domain with www: server_name example.com; return 301 $scheme://www.example.com$request_uri; I also wish for my https for anything under /user I get the error of too may redirects, where am I going wrong? So I have: server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /var/www/example.com/site; index index.html index.htm; # Make site accessible from http://localhost/ server_name example.com; return 301 $scheme://www.example.com$request_uri; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } location

ubuntu - non www to www domain?

I've changed my conf file so that when a user types in the domain without www it redirects to the domain with www: server_name example.com; return 301 $scheme://www.example.com$request_uri; I also wish for my https for anything under /user I get the error of too may redirects, where am I going wrong? So I have: server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /var/www/example.com/site; index index.html index.htm; # Make site accessible from http://localhost/ server_name example.com; return 301 $scheme://www.example.com$request_uri; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } location /user { rewrite ^ https://$http_host$request_uri? permanent; } } For port 443: server { listen 443; server_name example.com; return 301 $scheme://ww

linux - Growing OS cache in RAM causing high system CPU usage

I'm having a weird issue with a server that I've never seen before. On a machine with ~30G of RAM with an application that takes ~10G (spread across hundreds of processes). Over time the OS starts to fill up the spare RAM with cache and buffers (totally normal for Linux). I've seen this happen before without any problems, but on this machine as the amount of empty RAM decreases it drives the system CPU crazy (100% across 8 CPUs for ~3 minutes) at about the 256M mark. I'm guessing the OS is using all that CPU to shuffle memory around to get some free space back. From what I understand about Linux memory management it's supposed to use as much free space in RAM as it can for OS level caching but then give it over to any applications that need it when asked and from past experience this hasn't been a traumatic experience for the CPU. It happens al

linux - Growing OS cache in RAM causing high system CPU usage

I'm having a weird issue with a server that I've never seen before. On a machine with ~30G of RAM with an application that takes ~10G (spread across hundreds of processes). Over time the OS starts to fill up the spare RAM with cache and buffers (totally normal for Linux). I've seen this happen before without any problems, but on this machine as the amount of empty RAM decreases it drives the system CPU crazy (100% across 8 CPUs for ~3 minutes) at about the 256M mark. I'm guessing the OS is using all that CPU to shuffle memory around to get some free space back. From what I understand about Linux memory management it's supposed to use as much free space in RAM as it can for OS level caching but then give it over to any applications that need it when asked and from past experience this hasn't been a traumatic experience for the CPU. It happens all the time. So why could it be different here? I'm attaching a small portion of the vmstat output for the related me

virtualization - Starting VM as an executable with as low overhead as possible

itemprop="text"> Is there a solution to create a virtual machine and start it by having an executable file, that will start the machine? If possible to start as quickly as possible. Strange situation? Not at all. Read on... Real life scenario Since we can't have domain controller on a non-server OS it would be nice to have domain controller in an as thin as possible machine (possibly Samba or similar because we'd like to make it startup as quickly as possible - in a matter of a few seconds) packed in a single executable. We could then configure our non-server OS to run the executable when it starts and before user logs in. This would make it possible to login into a domain. Actual situation info For some peculiar reasons I want to run non-server OS at all costs. It's a Windows 7 x64 Enterprise OS. It's

virtualization - Starting VM as an executable with as low overhead as possible

Is there a solution to create a virtual machine and start it by having an executable file, that will start the machine? If possible to start as quickly as possible. Strange situation? Not at all. Read on... Real life scenario Since we can't have domain controller on a non-server OS it would be nice to have domain controller in an as thin as possible machine (possibly Samba or similar because we'd like to make it startup as quickly as possible - in a matter of a few seconds) packed in a single executable. We could then configure our non-server OS to run the executable when it starts and before user logs in. This would make it possible to login into a domain. Actual situation info For some peculiar reasons I want to run non-server OS at all costs. It's a Windows 7 x64 Enterprise OS. It's a development machine not connected to any domain. It's a standalone machine. I need to set it up for Sharepoint Server 2010 development. So I'm installing Sharepoint. With some

debian - Mysql-Server-5.1 upgrade problem

My System (Linux Debian) got updatet wirth apt-get update apt-get upgrade Everything got upgraded, also my mysql server. At the upgrade of mysql-server, I got a error message (unfortunately missing. It was at the, when I where asked for mysql admin password). There was just "Retry" or "cancel". After Retry didnt work, I choosed cancel ... Now the server can´t start anymore Mysql Error Log: 110502 07:49:48 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 110502 7:49:48 [Note] Plugin 'FEDERATED' is disabled. /usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist 110502 7:49:48 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. InnoDB: No valid checkpoint found. InnoDB: If this error appears when you are creating an Inn

debian - Mysql-Server-5.1 upgrade problem

My System (Linux Debian) got updatet wirth apt-get update apt-get upgrade Everything got upgraded, also my mysql server. At the upgrade of mysql-server, I got a error message (unfortunately missing. It was at the, when I where asked for mysql admin password). There was just "Retry" or "cancel". After Retry didnt work, I choosed cancel ... Now the server can´t start anymore Mysql Error Log: 110502 07:49:48 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 110502 7:49:48 [Note] Plugin 'FEDERATED' is disabled. /usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist 110502 7:49:48 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. InnoDB: No valid checkpoint found. InnoDB: If this error appears when you are creating an InnoDB database, InnoDB: the problem may be that during an earlier attempt you managed InnoDB: to create the InnoDB data files, but log file creation failed. InnoDB: If that is the

windows server 2016 - NTFS vhdx On REFS Mirrored Storage Spaces

I've been trying to figure this out now for sometime, but haven't found an answer. I have a Server 2016 VM running on HyperV Server 2016. It has a file storage VHDX formatted as NTFS that is sitting on a mirrored storage spaces virtual disk running ReFS. Will the files on the VHDX have the benefits of the file integrity streams or would I need to do REFS on both the storage spaces and the VHDX?

windows server 2016 - NTFS vhdx On REFS Mirrored Storage Spaces

I've been trying to figure this out now for sometime, but haven't found an answer. I have a Server 2016 VM running on HyperV Server 2016. It has a file storage VHDX formatted as NTFS that is sitting on a mirrored storage spaces virtual disk running ReFS. Will the files on the VHDX have the benefits of the file integrity streams or would I need to do REFS on both the storage spaces and the VHDX?

apache 2.2 - PHP code being displayed in clear text?

Setting up my first ever server from scratch for a migrated Wordpress site. It's been a long journey, but I'm almost at the end of this. This is what I've done so far. Created the GCP micro instance. This tutorial on how to setup the LAMP stack. - href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-debian" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-debian Followed a tutorial on how to setup virtual hosts - granted I'm still just trying to get the primary domain setup. (Can't post the link due to reputation level on ServerFault) Migrated my Wordpress database into the new instance. Edited my config files with the updates (I'm 99.9% wordpress is config

apache 2.2 - PHP code being displayed in clear text?

Setting up my first ever server from scratch for a migrated Wordpress site. It's been a long journey, but I'm almost at the end of this. This is what I've done so far. Created the GCP micro instance. This tutorial on how to setup the LAMP stack. - https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-debian Followed a tutorial on how to setup virtual hosts - granted I'm still just trying to get the primary domain setup. (Can't post the link due to reputation level on ServerFault) Migrated my Wordpress database into the new instance. Edited my config files with the updates (I'm 99.9% wordpress is configured correctly now after having gone through many tutorials and troubleshooting). When I hit the website - what I get instead is just clear text of the wordpress code to the site. This is strange also because my /wp-admin/ part of the site seems to be initializing the PHP. I've managed to open up the apache log fil

proxy - Apache httpd Problem

itemprop="text"> I am getting intermittent issues with my site. Pages often hang with huge loading times and sometimes fail to load. The httpd error logs contain the following: [Wed Feb 23 06:54:17 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 5871 for worker proxy:reverse [Wed Feb 23 06:54:17 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 5871 for (*) [Wed Feb 23 06:54:24 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 5872 for worker proxy:reverse [Wed Feb 23 06:54:24 2011] [debug] proxy_util.c(1873): proxy: worker proxy:reverse already initialized [Wed Feb 23 06:54:24 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 5872 for (*) [Wed Feb 23 06:59:15 2011] [debug] proxy_util.c(185

proxy - Apache httpd Problem

I am getting intermittent issues with my site. Pages often hang with huge loading times and sometimes fail to load. The httpd error logs contain the following: [Wed Feb 23 06:54:17 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 5871 for worker proxy:reverse [Wed Feb 23 06:54:17 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 5871 for (*) [Wed Feb 23 06:54:24 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 5872 for worker proxy:reverse [Wed Feb 23 06:54:24 2011] [debug] proxy_util.c(1873): proxy: worker proxy:reverse already initialized [Wed Feb 23 06:54:24 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 5872 for (*) [Wed Feb 23 06:59:15 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 5954 for worker proxy:reverse [Wed Feb 23 06:59:15 2011] [debug] proxy_util.c(1873): proxy: worker proxy:reverse already initialized The ser

apache 2.2 - Why are my httpd mpm_prefork processes being reaped so quickly?

[EDIT] Bad question, mostly - see my answer [/EDIT] We've got a system running RHEL6, x64. We are using a local installation of apache 2.2.22 from source. we serve primarily: mod_perl applications (with a local installation of perl 5.16.0) tomcat applications proxied with mod_jk Here is some context; the main question is below. All of this talks to an Oracle backend. We are having issues with Oracle becoming unresponsive. We think this is because we're hitting the maximum process limit in oracle. We've upped the process limit, but now we are hitting memory pressure on the oracle server. We have tons of oracle sessions sitting idle. I can trace a bunch of them back to the httpd processes. We have mod_perl's Apache::DBI start up a new connection to the database with each httpd child

apache 2.2 - Why are my httpd mpm_prefork processes being reaped so quickly?

[EDIT] Bad question, mostly - see my answer [/EDIT] We've got a system running RHEL6, x64. We are using a local installation of apache 2.2.22 from source. we serve primarily: mod_perl applications (with a local installation of perl 5.16.0) tomcat applications proxied with mod_jk Here is some context; the main question is below. All of this talks to an Oracle backend. We are having issues with Oracle becoming unresponsive. We think this is because we're hitting the maximum process limit in oracle. We've upped the process limit, but now we are hitting memory pressure on the oracle server. We have tons of oracle sessions sitting idle. I can trace a bunch of them back to the httpd processes. We have mod_perl's Apache::DBI start up a new connection to the database with each httpd child that's spawned. We are concerned that these are not always getting closed out properly when the httpd's exit...and the httpd's are exiting very frequently. I know that

mysql - LAMP memory management (CentOS)

First of all, I have to say I am not an expert in server administration. I have done web programming for 10+ years on several platforms, but have most of the time come to a readymade situation where there's IT professionals or a good web hosting company involved. Now I'm finally in a spot where I was required to build a LAMP-setup from scratch (with just a vanilla CentOS install) to serve a pretty intense Wordpress setup. Everything kinda went smoothly as I have been around the block with Linux-based server administration to get things running, but I'm getting really weird system freezes a few times per week and since I'm the only one who can access the server and boot up services, this is REALLY annoying. Here's some key data: Server 384MB memory CentOS 5.6 PHP 5.2.10 MySQL 5.0.77 Apache 2.2.3 Usage

mysql - LAMP memory management (CentOS)

First of all, I have to say I am not an expert in server administration. I have done web programming for 10+ years on several platforms, but have most of the time come to a readymade situation where there's IT professionals or a good web hosting company involved. Now I'm finally in a spot where I was required to build a LAMP-setup from scratch (with just a vanilla CentOS install) to serve a pretty intense Wordpress setup. Everything kinda went smoothly as I have been around the block with Linux-based server administration to get things running, but I'm getting really weird system freezes a few times per week and since I'm the only one who can access the server and boot up services, this is REALLY annoying. Here's some key data: Server 384MB memory CentOS 5.6 PHP 5.2.10 MySQL 5.0.77 Apache 2.2.3 Usage ca. 300 articles in Wordpress ca. 10k weekly unique users ca. 100k monthly pageviews Things done: All static stuff (jquery, styles, layout images) are server from an ex

smtp - Exchange 2013 Internal Relay via Smart Host

Thank you for your help in advance! I am currently setting up an Exchange 2013 server, to replace our old POP3/SMTP system, however we would like to roll this out gradually when convenient for our staff. Our plan is therefore: Setup Exchange 2013 to retrieve email via POP Connector - Done Setup Exchange 2013 to send ALL mail via a SmartHost - Issues I have set the domains in Mail Flow > Accepted Domains to Internal Relay, enabled a Smart Host for * as the domain name, and disabled/deleted the accounts that are not setup yet; however Exchange just bounces the emails with no errors.

smtp - Exchange 2013 Internal Relay via Smart Host

Thank you for your help in advance! I am currently setting up an Exchange 2013 server, to replace our old POP3/SMTP system, however we would like to roll this out gradually when convenient for our staff. Our plan is therefore: Setup Exchange 2013 to retrieve email via POP Connector - Done Setup Exchange 2013 to send ALL mail via a SmartHost - Issues I have set the domains in Mail Flow > Accepted Domains to Internal Relay, enabled a Smart Host for * as the domain name, and disabled/deleted the accounts that are not setup yet; however Exchange just bounces the emails with no errors.

email - SPF and IPv6 fails even if the reverse DNS is created

itemprop="text"> When sending mails to Gmail I get this error Received-SPF: fail (google.com: domain of test@domain.com does not designate 2a01:4f8:xxx::2 as permitted sender) client-ip=2a01:4f8:xxx::2; When I test the IPv6 2a01:4f8:xxx::2 reverse DNS ( href="https://network-tools.webwiz.net/reverse-dns.htm" rel="nofollow noreferrer">https://network-tools.webwiz.net/reverse-dns.htm ) it maps to the correct host smtp.domain.com v=spf1 a mx -all A record smtp targeting the IPv4 88.133.xxx.xxx MX record targeting smtp class="post-text" itemprop="text"> class="normal">Answer Looks like you lack an AAAA record for smtp with content 2a01:4f8:xxx::2 .

email - SPF and IPv6 fails even if the reverse DNS is created

When sending mails to Gmail I get this error Received-SPF: fail (google.com: domain of test@domain.com does not designate 2a01:4f8:xxx::2 as permitted sender) client-ip=2a01:4f8:xxx::2; When I test the IPv6 2a01:4f8:xxx::2 reverse DNS ( https://network-tools.webwiz.net/reverse-dns.htm ) it maps to the correct host smtp.domain.com v=spf1 a mx -all A record smtp targeting the IPv4 88.133.xxx.xxx MX record targeting smtp Answer Looks like you lack an AAAA record for smtp with content 2a01:4f8:xxx::2 .

ubuntu - Root user is not able to access

I had a ubuntu user which has root level privileges but I haven't created password for it, there are other user also on the machine but none of them have sudo permissions, unfortunately permissions on .ssh directory in the ubuntu home directory has been changed and now I cannot login using ubuntu user credentials and there is no user with sudo privileges, so what options I have left with to get myself connected from ubuntu user's credentials

ubuntu - Root user is not able to access

I had a ubuntu user which has root level privileges but I haven't created password for it, there are other user also on the machine but none of them have sudo permissions, unfortunately permissions on .ssh directory in the ubuntu home directory has been changed and now I cannot login using ubuntu user credentials and there is no user with sudo privileges, so what options I have left with to get myself connected from ubuntu user's credentials

Localhost reverse proxy fails nginx AWS Ubuntu

itemprop="text"> I am attempting to to host a Flask app with Gunicoron on a server that hosts multiple web services on Nginx. I am using AWS ubuntu as a test bed for evetually hosting it on said Nginx mutilple web service (that's not AWS). I've been trying to make it production status by changing the IP from external AWS to localhost 127.0.0.1 with socket 8006 as well as others. I tried to do the reverse proxying with no luck. I get a 502 Bad Gateway error with the following error: Site Error Log 2019/06/11 05:08:58 [error] 9310#9310: *9 connect() failed (111: Connection refused) while connecting to upstream, client: 162.155.112.131, server: 127.0.0.1, request: "GET /favicon.ico HTTP/1.1", upstream: " href="http://127.0.0.1:8006/favicon.ico" rel="nofollow noreferrer">http

Localhost reverse proxy fails nginx AWS Ubuntu

I am attempting to to host a Flask app with Gunicoron on a server that hosts multiple web services on Nginx. I am using AWS ubuntu as a test bed for evetually hosting it on said Nginx mutilple web service (that's not AWS). I've been trying to make it production status by changing the IP from external AWS to localhost 127.0.0.1 with socket 8006 as well as others. I tried to do the reverse proxying with no luck. I get a 502 Bad Gateway error with the following error: Site Error Log 2019/06/11 05:08:58 [error] 9310#9310: *9 connect() failed (111: Connection refused) while connecting to upstream, client: 162.155.112.131, server: 127.0.0.1, request: "GET /favicon.ico HTTP/1.1", upstream: " http://127.0.0.1:8006/favicon.ico ", host: AWS Error Log: 2019/06/11 05:08:08 [emerg] 9311#9311: open() "/run/nginx.pid" failed (13: Permission denied) 2019/06/11 05:08:25 [warn] 9313#9313: could not build optimal proxy_headers_hash, you should increas

linux - How to find which script on my server is sending spam emails?

My server is sending the spam email and I am not able to find out which script is sending them. The emails were all from nobody@myhost so disabled from the cpanel that nobody should not be allowed to send emails Now at least they are not going out, I keep receiving them. This is mail I get: A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: eckert@clearfieldjeffersonredcross.org Mail sent by user nobody being discarded due to sender restrictions in WHM->Tweak Settings ------ This is a copy of the message, including all the headers. ------ Return-path: Received: from nobody by cpanel.myserver.com with local (Exim 4.80) (envelope-from ) id 1UBBap-0007EM-9r for eckert@clearfieldjeffersonredc

linux - How to find which script on my server is sending spam emails?

My server is sending the spam email and I am not able to find out which script is sending them. The emails were all from nobody@myhost so disabled from the cpanel that nobody should not be allowed to send emails Now at least they are not going out, I keep receiving them. This is mail I get: A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: eckert@clearfieldjeffersonredcross.org Mail sent by user nobody being discarded due to sender restrictions in WHM->Tweak Settings ------ This is a copy of the message, including all the headers. ------ Return-path: Received: from nobody by cpanel.myserver.com with local (Exim 4.80) (envelope-from ) id 1UBBap-0007EM-9r for eckert@clearfieldjeffersonredcross.org; Fri, 01 Mar 2013 08:34:47 +1030 To: eckert@clearfieldjeffersonredcross.org Subject: Order Detail From: "Manager Ethan Finch" X-Mailer: Fscfz(ver.2.7