All Questions

322
votes
7answers
59k views

Something is burning in the server room; how can I quickly identify what it is?

The other day, we notice a terrible burning smell coming out of the server room. Long story short, it ended up being one of the battery modules that was burning up in the UPS unit, but it took a good ...
313
votes
12answers
55k views

How do I deal with a compromised server?

This is a Canonical Question about Server Security - Responding to Breach Events (Hacking) See Also: Tips for Securing a LAMP Server Reinstall after a Root Compromise? Canonical ...
292
votes
3answers
278k views

What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats?

I am responsible for maintaining two Debian servers. Every time I have to do anything with security certificates, I Google for tutorials and beat away until it finally works. However, in my searches ...
269
votes
21answers
49k views

How do you search for backdoors from the previous IT person?

We all know it happens. A bitter old IT guy leaves a backdoor into the system and network in order to have fun with the new guys and show the company how bad things are without him. I've never ...
248
votes
5answers
52k views

How does IPv4 Subnetting Work?

This is a Canonical Question about IPv4 Subnets. Related: How does IPv6 subnetting work and how does it differ from IPv4 subnetting? How does Subnetting Work, and How do you do it ...
247
votes
15answers
169k views

How do you find what process is holding a file open in Windows?

One thing that annoys me no end about Windows is the old "sharing violation" error. Often you can't identify what's holding it open. Usually it's just an editor or explorer just pointing to a relevant ...
241
votes
27answers
58k views

100% uptime for a web application

We received an interesting "requirement" from a client today. They want 100% uptime with off-site failover on a web application. From our web application's viewpoint, this isn't an issue. It was ...
239
votes
33answers
86k views

How can I sort du -h output by size

I need to get a list of human readable du output. However, du does not have a "sort by size" option, and piping to "sort" doesn't work with the human readable flag. For example, running: du | sort ...
228
votes
45answers
48k views

Why is Internet access and Wi-Fi always so terrible at large tech conferences? [closed]

Every tech conference I've ever been to, and I've been to a lot, has had absolutely abysmal Wi-Fi and Internet access. Sometimes it's the DHCP server running out of addresses. Sometimes the backhaul ...
210
votes
15answers
12k views

I've inherited a rat's nest of cabling. What now?

You know, you see pictures like below and sort of chuckle until you actually have to deal with it. I have just inherited something that looks like the picture below. The culture of the organization ...
204
votes
11answers
232k views

How to determine if a bash variable is empty?

What is the best way to determine if a variable in bash contains ""? I have heard it recommended that I do if [ "x$variable" = "x" ] Is that the correct way? (there must be something more ...
185
votes
61answers
10k views

Good tools that fit on a thumb drive [closed]

I have been on the lookout lately for some good tools to fill up my flash drive and I thought I would ask the Server Fault community for recommendations on good tools that will fit onto a thumb drive. ...
184
votes
14answers
6k views

What is this very short power cable called?

I have a couple of networking components in my rack that take giant AC adapters ("power bricks") that don't fit neatly into my rackmount PDU. I have one "thingy" that is shown below, and I need to ...
174
votes
9answers
27k views

Heartbleed: What is it and what are options to mitigate it?

This is a Canonical Question about understanding and remediating the Heartbleed security issue. What exactly is CVE-2014-0160 AKA "Heartbleed"? What is the cause, what OSs and versions of OpenSSL ...
173
votes
13answers
64k views

Any benefit or detriment from removing a pagefile on an 8GB RAM machine?

I'm running Windows 7 on a dual core, x64 AMD with 8GB RAM. Do I even need a pagefile? Will removing it help or hurt performance? Would it make a difference if this is a server or a desktop? Does ...
173
votes
16answers
316k views

Ping a Specific Port

Just a quick sanity check here. Can you ping a specific port of a machine, and if so, can you provide an example? I'm looking for something like ping ip address portNum.
166
votes
11answers
52k views

Can I nohup/screen an already-started process?

I'm doing some test-runs of long-running data migration scripts, over SSH. Let's say I start running a script around 4 PM; now, 6 PM rolls around, and I'm cursing myself for not doing this all in ...
161
votes
17answers
190k views

How do I tell Git for Windows where to find my private RSA key?

My GIT setup runs fine in Linux, but when I try to set things up under Windows (using Git for Windows and TortoiseGit), I don't know where to put my private ssh key (or, better still, how to tell ssh ...
159
votes
5answers
118k views

In Nginx, how can I rewrite all http requests to https while maintaining sub-domain?

I want to rewrite all http requests on my web server to be https requests, I started with the following: server { listen 80; location / { rewrite ^(.*) https://mysite.com$1 ...
159
votes
11answers
30k views

Is it bad to redirect http to https?

I just installed an SSL Certificate on my server. I use a web hosting panel called ZPanel that is an open source project. It then set up a redirect for all traffic on my domain on Port 80 to ...
153
votes
10answers
62k views

How to tell which local branch is tracking which remote branch in Git?

I would like to know if there's a way to tell which local branch is tracking which remote branch in Git. I'm using one remote server, which is named "origin".
149
votes
13answers
24k views

Why couldn't MAC addresses be used instead of IPv4|6 for networking? [closed]

I am reading up on TCP/IP and other related protocols and technologies. MAC addresses are described as being (reasonably :) unique, and as having a large possibility space (several hundred trillions), ...
146
votes
3answers
93k views

What's the best way of handling permissions for apache2's user www-data in /var/www?

Has anyone got a nice solution for handling files in /var/www? We're running Name Based Virtual Hosts and the apache2 user is www-data. We've got two regular users & root. So when messing with ...
142
votes
39answers
40k views

What useful things can one add to one's .bashrc? [closed]

Is there anything that you can't live without and will make my life SO much easier? Here are some that I use ('diskspace' & 'folders' are particularly handy). # some more ls aliases alias ll='ls ...
142
votes
2answers
11k views

Why is “chmod -R 777 /” destructive?

This is a Canonical Question about File Permission and Why 777 is "destructive". I'm not asking how to fix this problem, as there are a ton of references of that already on Server Fault ...
142
votes
5answers
20k views

Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted How to Know about Mod_Rewrite Rules but Were Afraid to Ask

This is a Canonical Question about Apache's mod_rewrite. Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This ...
128
votes
6answers
102k views

How to assign permissions to ApplicationPoolIdentity account

In IIS 7 on Windows Server 2008, application pools can be run as the "ApplicationPoolIdentity" account instead of the NetworkService account. How do I assign permissions to this ...
125
votes
8answers
10k views

What’s the point in having “www” in a URL?

Other than for historical reasons, is there is reason to have “www” in a URL. Should I do a permanent redirect from www.xyz.com to xyz.com or xyz.com to www.xyz.com? Which one would you suggest and ...
124
votes
4answers
4k views

Is my password compromised because I forgot to hit Enter after ssh username?

I've just tried logging into a Fedora (release 13 Goddard) server using SSH (PuTTY, Windows). For some reason the Enter after typing my username didn't go through and I typed in my password and hit ...
116
votes
12answers
10k views

Should servers be turned off at night?

There is a server that is used from 4:30 am in the morning until ~ 22:00. Should it be turned off? I think that it is a server and that it won't have a problem to stay on, but serious professors are ...
116
votes
5answers
32k views

LVM dangers and caveats

I have recently started using LVM on some servers for hard drives larger than 1 TB. They're useful, expandable and quite easy to install. However, I could not find any data about the dangers and ...
115
votes
19answers
80k views

How can I run a server on Linux on port 80 as a normal user?

I have googled about it for quite some time, but couldn't find it. I am on Ubuntu Linux and want to run a server on port 80, but due to security mechanism of Ubuntu, I get the following error: ...
113
votes
6answers
11k views

Are SSD drives as reliable as mechanical drives (2013)?

SSD drives have been around for several years now. But the issue of reliability still comes up. I guess this is a follow up from this question posted 4 years ago, and last updated in 2011. It's now ...
113
votes
5answers
153k views

MySQL: Bind to more than one IP address?

Is there a secret way to bind MySQL to more than one IP address? As far as I can see the bind-address parameter in the my.cnf does not support more than one IP and you can't have it more than once.
113
votes
9answers
101k views

What is a good SSH server to use on Windows? [closed]

In my spare time I remotely support my wife's office via VPN into a Windows Server. I am about to purchase a wireless broadband service which doesn't support VPN. I don't want to open up the remote ...
111
votes
4answers
6k views

All servers flooded by salt water, is it possible to recover data from multi-platter drives?

All of my servers are currently flooded by salt water. Is it possible for each platter in a multi-platter drive to be separated, cleaned, imaged, and merged into a new virtual drive for data ...
110
votes
25answers
207k views

Using DD for disk cloning

There's been a number of questions regarding disk cloning tools and dd has been suggested at least once. I've already considered using dd myself, mainly because ease of use, and that it's readily ...
110
votes
13answers
293k views

Why do I get “Permission denied (publickey)” when trying to SSH from local Ubuntu to a Amazon EC2 server?

I have an instance of an application running in the cloud on Amazon EC2 instance, and I need to connect it from my local Ubuntu. It works fine on one of local ubuntu and also laptop. I got message ...
108
votes
3answers
38k views

What is the difference between double and single square brackets in bash?

I just wondered what exactly the difference between [[ $STRING != foo ]] and [ $STRING != foo ] is, apart from that the latter is posix-compliant, found in sh and the former is an extension ...
106
votes
13answers
6k views

Engineers are using explosives to remove hard rock outside our office building. What countermeasures should we take?

Our building is located approx. 100 meters from the explosive charges. They happen several times per day, and really shake the entire building a lot. This is going to go on for many days and the ...
105
votes
2answers
14k views

What are the different widely used RAID levels and when should I consider them?

This is a Canonical Question about RAID levels. What are: the RAID levels typically used (including the RAID-Z family)? deployments are they commonly found in? benefits and pitfalls of each? ...
104
votes
17answers
131k views

CentOS vs. Ubuntu [closed]

I had a web server that ran Ubuntu, but the hard drive failed recently and everything was erased. I decided to try CentOS on the machine instead of Ubuntu, since it's based on Red Hat. That ...
104
votes
15answers
85k views

Why is DNS failover not recommended?

From reading, it seems like DNS failover is not recommended just because DNS wasn't designed for it. But if you have two webservers on different subnets hosting redundant content, what other methods ...
103
votes
12answers
103k views

How to set up Nginx as a caching reverse proxy?

I heard recently that Nginx has added caching to its reverse proxy feature. I looked around but couldn't find much info about it. I want to set up Nginx as a caching reverse proxy in front of ...
101
votes
7answers
162k views

What's the default superuser username/password for postgres after a new install?

I have just installed postgres 8.4 on Ubuntu 9.10 and it has never asked me to create a superuser. Is there a default superuser and its password? If not, how do I create a new one?
97
votes
23answers
8k views

How do you make it obvious you are on a production system?

A few of us at my company have root access on production servers. We are looking for a good way to make it exceedingly clear when we have ssh'd in. A few ideas we have had are: Bright red prompt ...
94
votes
9answers
6k views

Can you mount a network switch upside down?

We just took delivery of a new Avaya 2500 48-port switch, that has 24 PoE ports. The problem is that all the PoE ports are on the left-hand size of the switch, and our PoE device cables can only reach ...
93
votes
5answers
4k views

How to cd into a directory with this name “-2” (starting with the hyphen)?

I have a directory named: -2 I want to cd into it but the cd complains: bash: cd: -2: invalid option With no success, I've tried: cd "-2" cd '-2' cd \-2 Any solution? Edit: no file browsers ...
92
votes
7answers
101k views

How do I share a Git repository with multiple users on a machine?

I have a Git repository on a staging server which multiple developers need to be able to pull to. git-init seems to have a flag very close to what I'm looking for: --shared, except I'd like multiple ...
91
votes
15answers
143k views

How to use rsync over FTP

Any unix: I have the following cmd line which works fine. rsync -avr -e ssh /home/dir user@example.com:/home/ But I need to set it up now to rsync to a remote server that only has an FTP server on ...

15 30 50 per page