Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Volguus
Mar 3, 2009

Mr Shiny Pants posted:

When Linux sees a drive, but it is not mounted, does it still do powermanagement for the drive?

Maybe someone more knowledgeable can correct me on this, but I think it would. mounting has nothing to do with device management. when the drive is "seen" the appropriate kernel module for it is loaded. When the drive is mounted ... is just a filesystem issue.

Adbot
ADBOT LOVES YOU

Apex Rogers
Jun 12, 2006

disturbingly functional

Volguus posted:

Maybe someone more knowledgeable can correct me on this, but I think it would. mounting has nothing to do with device management. when the drive is "seen" the appropriate kernel module for it is loaded. When the drive is mounted ... is just a filesystem issue.

This is correct. The kernel driver will set up and manage the device, including power management. Mounting, as you say, is just a file system operation and can only happen once the driver has brought up the drive to be accessible.

Mr Shiny Pants
Nov 12, 2012

Apex Rogers posted:

This is correct. The kernel driver will set up and manage the device, including power management. Mounting, as you say, is just a file system operation and can only happen once the driver has brought up the drive to be accessible.

This is also my understanding thanks for clarifying, I am having a hell of a time getting Linux to run smooth on a NVMe drive.

evol262
Nov 30, 2010
#!/usr/bin/perl
Note that device enumeration isn't a driver per se. NVMe drives present directly on the PCIe bus, and SAS/SATA over HBAs. Those have drivers.

The block devices themselves (along with spindown, power, etc) are interrogated across whichever protocol is appropriate (scsi, NVM, etc), and managed by the blockdev subsystem. This is technically a "driver", but it's more like a protocol than the bit fiddling drivers generally do.

In this sense, as long as it's on blockdev, it can be tuned ifthe interrogation reports that it supports a given command.

However, since NVMe is on the PCIe bus, you can also directly power manage it through the bus itself. Check both

apropos man
Sep 5, 2016

You get a hundred and forty one thousand years and you're out in eight!
Since I've been working on RHEL/CentOS servers for the last few months, there have been many occasions where I log into a system and diagnose backup problems/grep through dmesg etc. There have also been quite a few times I've had to run e2fsck on filesystems that were past their maximum mount count in order to keep logs tidy etc.

Anyway, I just thought to myself that in all the time I've been using desktop Linux (getting on 5 years since noob), I've never run e2fsck on my daily driver machines or home server. Is this because they get rebooted frequently, unlike the servers at work which run for hundreds of days without reboot and have cronjobs mounting and unmounting the backup filesystems?

So is the filesystem check in fstab (<dev> <mountpoint> 1 1) the same check that e2fsck does, or is there a difference?

jaegerx
Sep 10, 2012

Maybe this post will get me on your ignore list!


apropos man posted:

Since I've been working on RHEL/CentOS servers for the last few months, there have been many occasions where I log into a system and diagnose backup problems/grep through dmesg etc. There have also been quite a few times I've had to run e2fsck on filesystems that were past their maximum mount count in order to keep logs tidy etc.

Anyway, I just thought to myself that in all the time I've been using desktop Linux (getting on 5 years since noob), I've never run e2fsck on my daily driver machines or home server. Is this because they get rebooted frequently, unlike the servers at work which run for hundreds of days without reboot and have cronjobs mounting and unmounting the backup filesystems?

So is the filesystem check in fstab (<dev> <mountpoint> 1 1) the same check that e2fsck does, or is there a difference?

First question. Yeah. You reboot and you probably don’t notice it runs a fsck. Second question. Yes but caveat. The last 1 is for when you’re running a tape dump. Or the first one. poo poo I can’t recall off my head. But yeah it’s for when you run a dump. It tells it to dump this file system.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
I want to set up a very basic mail server on my Centos 7 box. All I'm trying to do is have a contact form on my website and then have the ability for my auto-renew SSL cron to send me emails.

When I've tried this is the past, every tutorial online I've found was pretty terrible. Are there any tutorials you guys recommend?

Also I'm having this weird issue where ww w.domain.com is working but domain.com isn't despite being an alias. Is there anything I'm missing in my Virtual Host config below?

domain.com redirects to https://www.domain.com
www works fine

https://domain.com doesn't work
http://domain.com doesn't work

teen phone cutie fucked around with this message at 17:15 on Jun 23, 2018

Sheep
Jul 24, 2003
An actually sane/safe alternative would be to just use Gmail's SMTP relay service. Set up an app-specific password on your account and let it use Gmail for sending email, works great for stuff like this.

If for some reason you really want to run a server locally you could run postfix in a container , but you'll still want to read the documentation.

Sheep fucked around with this message at 13:38 on Jun 23, 2018

jre
Sep 2, 2011

To the cloud ?



Sheep posted:


Also I'm having this weird issue where ww w.domain.com is working but domain.com isn't despite being an alias. Is there anything I'm missing in my Virtual Host config below?

domain.com redirects to https://www.domain.com
www works fine

https://domain.com doesn't work
http://domain.com doesn't work



What does the section for your ssl.conf look like ?
I suspect you're missing the alias for domain.com in there.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

jre posted:

What does the section for your ssl.conf look like ?
I suspect you're missing the alias for domain.com in there.



everything's commented out? Honestly, I haven't touched this file

It looks like all my DNS settings are configured correctly. My zone is for domain.com and I have A records with both a blank hostname and a hostname of www

The only other thing that I can think of right now is that I changed my hostname to grump when initially configuring my server. Would that play any effect?

jre
Sep 2, 2011

To the cloud ?



Grump posted:



everything's commented out? Honestly, I haven't touched this file

It looks like all my DNS settings are configured correctly. My zone is for domain.com and I have A records with both a blank hostname and a hostname of www

The only other thing that I can think of right now is that I changed my hostname to grump when initially configuring my server. Would that play any effect?

Where have you configured SSL if that file is empty ? Did you use something like lets encrypt ?

nem
Jan 4, 2003

panel.dev
apnscp: cPanel evolved
_default_ is an oddity. If you have a virtualhost that's named with the IP address, it'll fall through to the first (or last... can't recall the specifics) virtualhost that matches it. _default_ only gets used when no other possible <VirtualHost IP:PORT> combination can match it. Name your IP address in there or don't name your IP address in any other <VirtualHost> container.

If you have 1.2.3.4 as your sole IP address and <VirtualHost 1.2.3.4:*> that'll match before _default_ matches.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

jre posted:

Where have you configured SSL if that file is empty ? Did you use something like lets encrypt ?

That’s exactly what I did and to be honest, it abstracted all the magic away from me. The only question I was asked during setup was whether I wanted to redirect http to https

jre
Sep 2, 2011

To the cloud ?



nem posted:

. Name your IP address in there or don't name your IP address in any other <VirtualHost> container.


Don't do any of that ^^^^, it'll gently caress up what you already have

Grump posted:

That’s exactly what I did and to be honest, it abstracted all the magic away from me. The only question I was asked during setup was whether I wanted to redirect http to https

Did you specify
code:
www.domain.com
and then
code:
domain.com
as an alternate name when you did the letsencrypt set up, or did you just enter
code:
www.domain.com
?

You should have a file called something like vhost_alias-le-ssl.conf the conf.d folder

Also can you expand a bit on "doesn't work" exactly what happens when you go to
code:
http://domain.com
?

jre fucked around with this message at 12:18 on Jun 24, 2018

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

jre posted:

Don't do any of that ^^^^, it'll gently caress up what you already have


Did you specify
code:
www.domain.com
and then
code:
domain.com
as an alternate name when you did the letsencrypt set up, or did you just enter
code:
www.domain.com
?

You should have a file called something like vhost_alias-le-ssl.conf the conf.d folder

Also can you expand a bit on "doesn't work" exactly what happens when you go to
code:
http://domain.com
?

Here's my /etc/httpd/conf.d/vhost-le-ssl.conf file.

What I mean by "doesn't work" is that when I visit the page on chrome, I get "This site cannot be reached. Took too long to respond."

When I set up the Let's Encrypt, it asked me which domains I want to install the SSL for and by default it gave me domain.com and www . domain.com

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum
Do you have DNS records for each domain?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

anthonypants posted:

Do you have DNS records for each domain?

Yep. I have A records with both www and a blank hostname for both IPv4 and IPv6

evol262
Nov 30, 2010
#!/usr/bin/perl
When you try to connect to the alias, anything in apache logs?

kujeger
Feb 19, 2004

OH YES HA HA
if you do a dns lookup from the machine you're connecting to the webserver with, you get the right IPs, right?

xzzy
Mar 5, 2009

Server taking too long to respond is a browser error, not a web server error. So looking at your apache config is not going to fix that problem.

Whatever IP your browser is getting from name resolution is dropping packets, probably due to a firewall somewhere.

(if the port was not open but your client could reach the IP in question, you'd get a connection refused error)

evol262
Nov 30, 2010
#!/usr/bin/perl
Eh, the port is open, because it's an alias. The server has 443 open.

It's entirely possible that it's still the apache config. If it were firewall, the other vhost would be blocked. I suggested logs because it may be a bad url rewrite or something else which makes Apache say "hey, I'll answer this, but now I don't know what to do with it"
access_log and error_log will probably show you what's happening

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
so, it seems like the domain name is resolving fine on other computers?

I would expect some issues on the computer I constantly visit the site on, but it's been 3 days since I set up my DNS records and Virtual Hosts. Why would I still be having issues on this machine? I tried running ipconfig /flushdns, but that didn't help.

The logs look relatively normal as well. Is it possible it's a firewall issue on the server?

teen phone cutie fucked around with this message at 00:27 on Jun 26, 2018

evol262
Nov 30, 2010
#!/usr/bin/perl
Please tail the logs and try to connect, then paste the lines which show up

bort
Mar 13, 2003

Grump posted:

so, it seems like the domain name is resolving fine on other computers?
Checked a different browser/incognito mode?
edit:

quote:

Is it possible it's a firewall issue on the server?
No, because you're redirecting fine when you use http://domain.com.

One thought is to adjust the rewrite rule so it's not using a variable...edit coming...

bort fucked around with this message at 00:32 on Jun 26, 2018

xzzy
Mar 5, 2009

Sorry, missed that the www variant was working fine.

Get a dig tool or use a web based one and verify resolution for all the associated domains returns the IP you expect. Actually, do both: your local machine and some random 3rd party. This will isolate any caching issues.

Then consider stripping down the apache config to basically nothing, get port 80 working, then add on 443. Apache's config file scheme is a little myopic if you aren't used to it but it's not magic and there should be a billion vhost samples you can cut and paste off the internet.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
e: okay. Pinging the site gives me the wrong ip address.

How did I not realize that

Pinging www gives me ipv6 and pinging non-www gives me the old ipv4 that the DNS was using before.

Pinging the site from another computer gives me the right ip. Is this just a waiting game at this point then?

teen phone cutie fucked around with this message at 00:40 on Jun 26, 2018

bort
Mar 13, 2003

edit:

quote:

Is it possible it's a firewall issue on the server?
No, because you're redirecting fine when you use http://domain.com.

One thought is to adjust the rewrite rule so it's not using a variable:
code:
RewriteRule ^ https://www.domain.com/%{REQUEST_URI} [END, NE, R=permanent]
(since you say above that the redirect to https://www.domain.com is working)

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

Grump posted:

e: okay. Pinging the site gives me the wrong ip address.

How did I not realize that

Pinging www gives me ipv6 and pinging non-www gives me the old ipv4 that the DNS was using before.

Pinging the site from another computer gives me the right ip. Is this just a waiting game at this point then?
An IPv6 address would indicate there's a AAAA record out there somewhere, in addition to the A records you mentioned earlier.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
yeah I have an ipv4 for both www and non-www and an ipv6 record for both.

Is that bad? These were the default records I was provided with when I set me DNS records up

bort
Mar 13, 2003

Ping isn't a perfect test (use
pre:
curl -k https://domain.com
if you have it) -- you may get different results from ping and a browser call. ipv6 isn't bad, per se, it's just more complexity and you won't really notice if it's being employed in your https call (you can use a browser plugin, but that all happens at layer 3, aka "below the hood" of anything you're doing).

Again, the strategy to strip things bare and then add them in is valid. Take out the ipv6 AAAA record. Nobody will be using it to reach you, anyway :can:

edit: I really do think the rewrite rule is the culprit. My suggestion above, or removing the "R=permanent" flag may help. (That's issuing a redirect to the browser, and that's where you're seeing your error behavior).

bort fucked around with this message at 01:07 on Jun 26, 2018

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
I was forcing my old IP in my local hosts file :bang:

I must have set that up months ago and forgot. Thanks for all the help guys, and sorry for the trouble.

Volguus
Mar 3, 2009

Grump posted:

I was forcing my old IP in my local hosts file :bang:

I must have set that up months ago and forgot. Thanks for all the help guys, and sorry for the trouble.

It's always DNS

bort
Mar 13, 2003

quote:

domain.com redirects to https://www.domain.com
www works fine
:confused:

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Yeah i’m not really sure. In a nutshell, the only instances that were giving me errors were when i appended domain.com to either http or https

Plain old domain.com redirected correctly

My hosts file on my computer looked like

domain.com *bad ip address here*

Beyond that, :iiam:

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Back to getting a mail server setup, someone suggested using Gmail.

Something like https://devops.profitbricks.com/tutorials/configure-a-postfix-relay-through-gmail-on-centos-7/ would allow me to send mail with the PHP mail() function and send mail with a cron?

bort
Mar 13, 2003

edit: nevermind

bort fucked around with this message at 00:11 on Jun 27, 2018

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
I just want a contact form on my site. And I want to send mail the easiest and cheapest way possible

I tried setting a mail server up a couple months ago and it was nothing but trouble

xzzy
Mar 5, 2009

I think as long as they get their spf and dkim records set up properly there won't be any issues. It's not easy to do, but it's not hard either. If I remember correctly far enough back in the thread they just want to send the occasional email and that's a reasonable thing to want to do.

There's certainly easier and more modern ways to get this done, but as a learning exercise it's not a horrible idea. The more people who know how to be good smtp citizens, the better.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
If there’s better ways to do this, I’d love to try

Adbot
ADBOT LOVES YOU

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

Grump posted:

I just want a contact form on my site. And I want to send mail the easiest and cheapest way possible

I tried setting a mail server up a couple months ago and it was nothing but trouble
It is the year 2018 and the PHP mail() function is neither the easiest nor the cheapest SMTP connector to Gmail.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply