foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)
foxfirefey ([personal profile] foxfirefey) wrote in [site community profile] dw_dev2018-12-08 06:48 pm

Can't figure out subdomains on my personal subdomain dreamhack!

State of the server:

* Follows pretty closely with instructions on http://wiki.dwscoalition.org/wiki/index.php/Dreamwidth_Scratch_Installation -- Ubuntu 16.04.4 x64 on DigitalOcean
* Server user dw, git checked out in the home directory as dw
* Using a subdomain: dev.memewidth.org, so the journal subdomains are like foxfirefey.dev.memewidth.org
* The main domain works, but all subdomains endlessly redirect to themselves. That is, if you go to foxfirefey.dev.memewidth.org, it will redirect to foxfirefey.dev.memewidth.org, until the browser quits trying since it will never actually resolve



The only apache config in /etc/apache2/sites-enabled, which is taken from the instructions:

# install in /etc/apache2/sites-enabled directory

ServerName localhost

User dw
Group dw

PerlSetEnv  LJHOME /home/dw/dw
PerlPassEnv LJHOME

PerlRequire /home/dw/dw/cgi-bin/modperl.pl

StartServers 1

<VirtualHost *:80>
        ServerAdmin dw@localhost
        DocumentRoot /home/dw/dw/htdocs
        UseCanonicalName off
        ErrorLog /home/dw/apache_logs/error.log
        CustomLog /home/dw/apache_logs/access.log combined
</VirtualHost>

<Directory /home/dw/dw/>
           Options FollowSymLinks
           AllowOverride None
           Require all granted
</Directory>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


I have not changed the default VHOST settings:

    # Support URLs of the form http://username.yoursite.com/ ?
    # If so, what's the part after "username." ?
    $USER_VHOSTS = 1;
    $USER_DOMAIN = $DOMAIN;

    # If you ONLY want USER_VHOSTS to work and not the typical /users/USER and /community/USER
    # then set this option:
    $ONLY_USER_VHOSTS = 1;


A hit to dev.memewidth.org forwards to www.dev.memewidth.org and functions:

50.35.71.224 - - [09/Dec/2018:02:22:30 +0000] "GET / HTTP/1.1" 302 673 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
50.35.71.224 - - [09/Dec/2018:02:22:30 +0000] "GET / HTTP/1.1" 200 4845 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
50.35.71.224 - - [09/Dec/2018:02:22:31 +0000] "GET /stc/??lj_base.css,esn.css,jquery/jquery.ui.core.css,jquery/jquery.ui.tooltip.css,jquery.contextualhover.css,jquery/jquery.ui.theme.smoothness.css,lj_base-app.css,base-colors-light.css,reset.css,tropo/tropo-base.css,tropo/tropo-red.css?v=1543992253 HTTP/1.1" 200 13292 "http://www.dev.memewidth.org/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"

A hit to a subdomain shows up in the apache access log as:

50.35.71.224 - - [09/Dec/2018:01:43:19 +0000] "GET / HTTP/1.1" 302 698 "http://www.dev.memewidth.org/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
50.35.71.224 - - [09/Dec/2018:01:43:19 +0000] "GET / HTTP/1.1" 302 697 "http://www.dev.memewidth.org/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"

Repeated until the browser gives up.

What's served on curl:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://foxfirefey.dev.memewidth.org/">here</a>.</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at foxfirefey.dev.memewidth.org Port 80</address>
</body></html>


Tailing /var/log/apache2/error.log doesn't make anything appear during the problematic request, however I do get a lot of errors when starting up the server (not sure why they happen twice since we're only starting up one, I think, given the config):

Subroutine get_all_paths redefined at /home/dw/dw/cgi-bin/LJ/Directories.pm line 30.
Subroutine get_all_files redefined at /home/dw/dw/cgi-bin/LJ/Directories.pm line 42.
Subroutine get_all_directories redefined at /home/dw/dw/cgi-bin/LJ/Directories.pm line 46.
Subroutine resolve_file redefined at /home/dw/dw/cgi-bin/LJ/Directories.pm line 50.
Subroutine resolve_directory redefined at /home/dw/dw/cgi-bin/LJ/Directories.pm line 54.
NOTE: Google::Checkout::* Perl modules were not found.
Subroutine Unicode::MapUTF8::AUTOLOAD redefined at /home/dw/dw/cgi-bin/ljlib.pl line 130.
Subroutine locker redefined at /home/dw/dw/cgi-bin/ljlib.pl line 239.
Subroutine gearman_client redefined at /home/dw/dw/cgi-bin/ljlib.pl line 253.
Subroutine theschwartz redefined at /home/dw/dw/cgi-bin/ljlib.pl line 265.
Subroutine gtop redefined at /home/dw/dw/cgi-bin/ljlib.pl line 287.
Subroutine load_props redefined at /home/dw/dw/cgi-bin/ljlib.pl line 299.
Subroutine get_prop redefined at /home/dw/dw/cgi-bin/ljlib.pl line 346.
Subroutine load_codes redefined at /home/dw/dw/cgi-bin/ljlib.pl line 377.
Subroutine clear_caches redefined at /home/dw/dw/cgi-bin/ljlib.pl line 420.
Subroutine handle_caches redefined at /home/dw/dw/cgi-bin/ljlib.pl line 434.
Subroutine start_request redefined at /home/dw/dw/cgi-bin/ljlib.pl line 465.
Subroutine end_request redefined at /home/dw/dw/cgi-bin/ljlib.pl line 621.
Subroutine site_variables_list redefined at /home/dw/dw/cgi-bin/ljlib.pl line 629.
Subroutine use_ssl_site_variables redefined at /home/dw/dw/cgi-bin/ljlib.pl line 633.
Subroutine use_config_site_variables redefined at /home/dw/dw/cgi-bin/ljlib.pl line 649.
Subroutine flush_cleanup_handlers redefined at /home/dw/dw/cgi-bin/ljlib.pl line 659.
Subroutine work_report_start redefined at /home/dw/dw/cgi-bin/ljlib.pl line 667.
Subroutine work_report_end redefined at /home/dw/dw/cgi-bin/ljlib.pl line 668.
Subroutine work_report redefined at /home/dw/dw/cgi-bin/ljlib.pl line 673.
Subroutine color_fromdb redefined at /home/dw/dw/cgi-bin/ljlib.pl line 718.
Subroutine color_todb redefined at /home/dw/dw/cgi-bin/ljlib.pl line 733.
Subroutine get_remote_ip redefined at /home/dw/dw/cgi-bin/ljlib.pl line 742.
Subroutine md5_struct redefined at /home/dw/dw/cgi-bin/ljlib.pl line 750.
Subroutine urandom redefined at /home/dw/dw/cgi-bin/ljlib.pl line 781.
Subroutine urandom_int redefined at /home/dw/dw/cgi-bin/ljlib.pl line 798.
Subroutine rand_chars redefined at /home/dw/dw/cgi-bin/ljlib.pl line 809.
Subroutine get_secret redefined at /home/dw/dw/cgi-bin/ljlib.pl line 826.
Subroutine is_web_context redefined at /home/dw/dw/cgi-bin/ljlib.pl line 867.
Subroutine load_include redefined at /home/dw/dw/cgi-bin/ljlib.pl line 875.
Subroutine bit_breakdown redefined at /home/dw/dw/cgi-bin/ljlib.pl line 914.
Subroutine last_error_code redefined at /home/dw/dw/cgi-bin/ljlib.pl line 923.
Subroutine last_error redefined at /home/dw/dw/cgi-bin/ljlib.pl line 928.
Subroutine error redefined at /home/dw/dw/cgi-bin/ljlib.pl line 946.
Subroutine get_useragent redefined at /home/dw/dw/cgi-bin/ljlib.pl line 967.
Subroutine assert_is redefined at /home/dw/dw/cgi-bin/ljlib.pl line 994.
Subroutine no_utf8_flag redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1005.
Subroutine in_test redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1013.
Subroutine AUTOLOAD redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1018.
Subroutine conf_test redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1027.
Subroutine is_enabled redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1034.
Subroutine list_valid_args redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1046.
Subroutine opt_fields redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1071.
Subroutine user_caused redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1072.
Subroutine fields redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1075.
Subroutine user_caused redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1076.
Subroutine as_string redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1078.
Subroutine get_all_paths redefined at /home/dw/dw/cgi-bin/LJ/Directories.pm line 30.
Subroutine get_all_files redefined at /home/dw/dw/cgi-bin/LJ/Directories.pm line 42.
Subroutine get_all_directories redefined at /home/dw/dw/cgi-bin/LJ/Directories.pm line 46.
Subroutine resolve_file redefined at /home/dw/dw/cgi-bin/LJ/Directories.pm line 50.
Subroutine resolve_directory redefined at /home/dw/dw/cgi-bin/LJ/Directories.pm line 54.
NOTE: Google::Checkout::* Perl modules were not found.
Subroutine Unicode::MapUTF8::AUTOLOAD redefined at /home/dw/dw/cgi-bin/ljlib.pl line 130.
Subroutine locker redefined at /home/dw/dw/cgi-bin/ljlib.pl line 239.
Subroutine gearman_client redefined at /home/dw/dw/cgi-bin/ljlib.pl line 253.
Subroutine theschwartz redefined at /home/dw/dw/cgi-bin/ljlib.pl line 265.
Subroutine gtop redefined at /home/dw/dw/cgi-bin/ljlib.pl line 287.
Subroutine load_props redefined at /home/dw/dw/cgi-bin/ljlib.pl line 299.
Subroutine get_prop redefined at /home/dw/dw/cgi-bin/ljlib.pl line 346.
Subroutine load_codes redefined at /home/dw/dw/cgi-bin/ljlib.pl line 377.
Subroutine clear_caches redefined at /home/dw/dw/cgi-bin/ljlib.pl line 420.
Subroutine handle_caches redefined at /home/dw/dw/cgi-bin/ljlib.pl line 434.
Subroutine start_request redefined at /home/dw/dw/cgi-bin/ljlib.pl line 465.
Subroutine end_request redefined at /home/dw/dw/cgi-bin/ljlib.pl line 621.
Subroutine site_variables_list redefined at /home/dw/dw/cgi-bin/ljlib.pl line 629.
Subroutine use_ssl_site_variables redefined at /home/dw/dw/cgi-bin/ljlib.pl line 633.
Subroutine use_config_site_variables redefined at /home/dw/dw/cgi-bin/ljlib.pl line 649.
Subroutine flush_cleanup_handlers redefined at /home/dw/dw/cgi-bin/ljlib.pl line 659.
Subroutine work_report_start redefined at /home/dw/dw/cgi-bin/ljlib.pl line 667.
Subroutine work_report_end redefined at /home/dw/dw/cgi-bin/ljlib.pl line 668.
Subroutine work_report redefined at /home/dw/dw/cgi-bin/ljlib.pl line 673.
Subroutine color_fromdb redefined at /home/dw/dw/cgi-bin/ljlib.pl line 718.
Subroutine color_todb redefined at /home/dw/dw/cgi-bin/ljlib.pl line 733.
Subroutine get_remote_ip redefined at /home/dw/dw/cgi-bin/ljlib.pl line 742.
Subroutine md5_struct redefined at /home/dw/dw/cgi-bin/ljlib.pl line 750.
Subroutine urandom redefined at /home/dw/dw/cgi-bin/ljlib.pl line 781.
Subroutine urandom_int redefined at /home/dw/dw/cgi-bin/ljlib.pl line 798.
Subroutine rand_chars redefined at /home/dw/dw/cgi-bin/ljlib.pl line 809.
Subroutine get_secret redefined at /home/dw/dw/cgi-bin/ljlib.pl line 826.
Subroutine is_web_context redefined at /home/dw/dw/cgi-bin/ljlib.pl line 867.
Subroutine load_include redefined at /home/dw/dw/cgi-bin/ljlib.pl line 875.
Subroutine bit_breakdown redefined at /home/dw/dw/cgi-bin/ljlib.pl line 914.
Subroutine last_error_code redefined at /home/dw/dw/cgi-bin/ljlib.pl line 923.
Subroutine last_error redefined at /home/dw/dw/cgi-bin/ljlib.pl line 928.
Subroutine error redefined at /home/dw/dw/cgi-bin/ljlib.pl line 946.
Subroutine get_useragent redefined at /home/dw/dw/cgi-bin/ljlib.pl line 967.
Subroutine assert_is redefined at /home/dw/dw/cgi-bin/ljlib.pl line 994.
Subroutine no_utf8_flag redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1005.
Subroutine in_test redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1013.
Subroutine AUTOLOAD redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1018.
Subroutine conf_test redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1027.
Subroutine is_enabled redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1034.
Subroutine list_valid_args redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1046.
Subroutine opt_fields redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1071.
Subroutine user_caused redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1072.
Subroutine fields redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1075.
Subroutine user_caused redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1076.
Subroutine as_string redefined at /home/dw/dw/cgi-bin/ljlib.pl line 1078.
[Sun Dec 09 20:54:47.898180 2018] [mpm_prefork:notice] [pid 2592] AH00163: Apache/2.4.18 (Ubuntu) mod_apreq2-20090110/2.8.0 mod_perl/2.0.9 Perl/v5.22.1 configured -- resuming normal operations
[Sun Dec 09 20:54:47.898345 2018] [core:notice] [pid 2592] AH00094: Command line: '/usr/sbin/apache2'

I also see this error intermittently in there though I do not seem to be able to reproduce it on purpose or figure out when it gets triggered, and it seems kind of related to my problem:

Use of uninitialized value in lc at /home/dw/dw/cgi-bin/DW/Request/Base.pm line 55.

With line 55 being the return statement of:

sub host {
    return lc $_[0]->header_in("Host");
}



I know I must be doing something wrong, but have been having a hard time figuring out what, and if anybody has any pointers or avenues I should investigate I'd be very happy to hear of them.

Post a comment in response:

From:
Anonymous
OpenID
Identity URL: 
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org


 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.