Bingology - The Blog of Aaron 'BingoBoingo' Rogier

ADD7A9A28F85E5EF1F51904F309BB8D7F3251143
About | Contact | PGP Public Key | Archive
« I Sit. I Weigh.
Some Uruguay Pictures »

Reasonable LAMP Setup For MP-WP On CentOS 6 (And 'anyserver' terms of use)

With the rack where UY1 lived going dark the call was made for to stand up an interim server "anywhere online" and so the interim host 'anyserver' was stood up. The server was sourced from a Kansas City based operation calling itself "Wholesale Internet" where I in the past have stoop up a box to run a trb node. Before getting to the recipe I want to collect a few general points about the host 'anyserver':

Notes On And Terms For Using 'anyserver'

  1. As 'anyserver' was Fast and Cheap, I have reservations about its potential to be good or great. This is intended as a strictly interim solution to bring blogs out of the dark until the space is sufficiently explored and plumbed for better solutions.
  2. As 'anyserver' is materially different from the currently dark UY1 shared server, especially for fact I can't take a leisurely walk over to see it, touch it, and grab backups... Folks who had blogs on Pizarro shared hosting need to explicitly request interim hosting on 'anyserver'.
  3. I am extending the offer to host on 'anyserver' as a courtesy, it is not a continuation of Pizarro shared hosting. For this reason and to give 'anyserver' the best chance to keep blogs online, accounts granted on 'anyserver' are to be used for blogs only. NO IRC BOUNCERS ON 'anyserver'! Especially no uncloaked irc bouncers. Anyone caught running an IRC bouncer from 'anyserver' without being able to cite a line in a logged channel where I offer permission for them to do by name so will be invoiced 2 BTC1 and find their account on 'anyserver' terminated.
  4. As this is an interim hosting solution, I am not inclined to put any blog on 'anyserver' that has already found another interim hosting solution. At least not without a compelling case being made, in a logged channel.
  5. I plan to keep anyserver running in its present role for 3 months. During this time I will issue no invoices for 'anyserver' hosting. If no in WoT alternative emerges in 3 months I may extend the courtesy of hosting on anyserver longer. If there is an in WoT alternative or alternatives at that time I expect folks to make arrangements to move their www sites.
  6. As I can't simply walk over and take a backup, folks need to take their own backups. If you publish a post grab a database dump, etc.

On To LAMP Building

One nice thing about CentOS is that it sticks to older versions of software. The downside is these are the wrong old versions. To set up 'anyserver' apache 2.2.34,2 php 5.6.40,3 and Mysql 5.5 were selected. The apache and php versions were selected for being 'end of life' releases, the mysql version was selected because going older than 5.5 means some blogs would need their character set encoding flags changed. Instructions for building an apache and php that work together were cribbed from the php.net instructions (archived).

The tarballs used and sha256 hashes offered with the downloads from where they were taken in the wild.

Apache 2.2.34 sha256 a89196d2f8c1ec2b213180dba2b534153b87dbb51d5cd2c90cd3feff7700d07b (sha256 page archived)
PHP 5.6.40 sha256 56fb9878d12fdd921f6a0897e919f4e980d930160e154cbde2cc6d9206a27cac (download page archived)

Once you have the tarballs in your working directory

tar -zxvf

them and start with apache because php will need to build against the apache.

cd httpd-2.2.34
./configure --prefix=/usr/local/apache2 --enable-mods-shared="all"
make
make install

Might as well build all of the mods up front whether the plan is to actually have apache load them or not. On to php:

cd php-src-php-5.6.40
./buildconf --force
./configure --prefix=/usr/local/php --enable-fpm --disable-short-tags --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-pcre-regex --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-exif --with-gd --enable-intl --enable-mbstring --enable-pcntl --with-pdo-mysql --enable-soap --enable-sockets --with-xmlrpc --enable-zip --with-jpeg-dir --with-png-dir
make clean
make
make install
libtool --finish /[workingdirpath]/php-src-php-5.6.40/libs
cp php.ini-production /usr/local/lib/php.ini

Along the way here php will prompt you with a strong suggestion to run some tests. It takes time, but I recommend doing the tests. At this point you should have a php that's linked into apache2 and ready for MySQL. Less flags can be used as long as --with-apxs2=/usr/local/apache2/bin/apxs and --with-mysql are present. How many other configure flags can be stripped out while enabling a pleasant MP-WP environment is a question open for exploration. It's time to check php.ini for insanity, set your max file upload size, and get all that out of the way.

Find or write and init script so the init system can manage apache. I lack confidence in this area to specify a particular one at this time. Use it to manage apache.

Play with the your apache.conf file. Important thing include enabling modules:

LoadModule authz_host_module modules/mod_authz_host.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module modules/libphp5.so

These are going to need to be loaded at a minimum. Depending on what you are trying to do more are likely to be beneficial depending on your use case. Other things to have:

User apache
Group apache

Making sure apache has its own user and group.


    Order allow,deny
    Deny from all
    Satisfy All

This keeps apache from serving .htaccess files.


    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

Reasonable defaults for a directory serving files. Allows more specific .htaccess rules to be used for MP-WP. There's other options to explore. Now you can throw up a test index.php file in your web root. Apache and php should be singing together. If they aren't leave a comment.

Now you install MySQL. Some 5.5.x where x>3 should be fine. Going older can be fine. Just get a MySQL going and note where my.conf is. Go into my.conf and add the following two lines.

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
default-storage-engine = MyISAM
bind-address=127.0.0.1

Unless you are intentionally doing a clustered setup, only the localhost should be talking to MySQL. If you are using MySQL for MP-WP MyISAM is a good storage engine that realsonably balances caching and RAM use. Depending on your version of MySQL MyISAM may already be the default, still best practice is to declare these things explicitly. Then take MySQL through its setup script setting a root password, doing the initial hardening, etc.

Now add a MySQL user and database.

create database name;
create user 'username'@'localhost' identified by 'longpasswordstring';
grant all privileges on name.* to 'username'@'localhost';

If you have a MySQL dump to populate the database follow up with:

mysql -uusername -p name < your.sql

Now setup your apache vhost, if you will be managing your site that way instead of straight out of httpd.conf with a stanza like:


        ServerName site.net
        ServerAlias  www.site.net
        DocumentRoot "/path/www"
        LogFormat "%h %l %u %t \"%r\" %>s %b" common
        CustomLog /path/wwwlogs/access.log common
        ErrorLog /path/wwwlogs/error.log

        KeepAlive Off
        LogLevel info

        
            AllowOverride All
            Options FollowSymlinks
            Order allow,deny
            Allow from all
            DirectoryIndex index.php index.html
        

        LogLevel warn

and start up your apache.

service httpd start

Things should click and the blog should sing. If not check the error log. If the error log is empty make sure apache can write it, and repeat.

  1. As access to 'anyserver' is being extended as a courtesy to bring blogs online, abusing this courtesy and undermining the cause by running an entirely different kind of target known to draw aggro is indeed an abuse. I will extend a grace period of up to 48 hours after the publication of this piece where I will merely kill running IRC processes. After that the options are pay up, maybe negotiate a settlement, or eat a -10 rating. Failure to read is not a defense. This is not an "I don't like irc bouncers" thing. This is a "Fuck you for making a target rich environment still more target rich along a line actively drawing aggro" penalty. [↩]
  2. This is the last version that supports .htaccess allow/deny statements to be used out of the box. [↩]
  3. Selected since the MP-WP V tree produces an MP-WP that lives on php 5.6 already [↩]

This entry was posted on Wednesday, October 16th, 2019 at 6:55 p.m. and is filed under Computing, Exercises, Republican Captures. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

6 Responses to “Reasonable LAMP Setup For MP-WP On CentOS 6 (And 'anyserver' terms of use)”

  1. lobbes says:
    October 16, 2019 at 7:17 p.m.

    Funnily enough, I also have been using "Wholesale Internet" for a few years nao as one of my redundant leased boxen. So far no issues with them. (Though defo not good for trb hosting; but this may have been due to my stupidity of using an hdd)

    Reply
    • BingoBoingo says:
      October 17, 2019 at 4:33 p.m.

      Mine stayed sync'd one it finally got sync'd. I regret letting it go to focus on Uruguay.

      Reply
  2. Mircea Popescu says:
    October 17, 2019 at 4:52 a.m.

    I was expecting footnote 1 to read "this is what the whole thing cost, you break it, you buy it", but then figured out it's not 2014 anymore.

    Neways, very nice of you!

    Reply
    • BingoBoingo says:
      October 17, 2019 at 4:37 p.m.

      Well, more "You break it, you pay for the next one." This box is embarassingly inexpensive with 16 GB ram, claims AMD Phenom, and 120GB SSD + 2TB spinning rust. If this box falls I cannot see the next 'anyotherserver' hitting anywhere near the same price point. Compiling it seemed to perform as an actual box rather than a virtual simulated box, but its hard to tell from a distance. Touching the boxes... it spoils a person's expectations.

      Reply
  3. Contribution Guidelines for TMSR OS « Dorion Mode says:
    December 14, 2019 at 6:31 a.m.

    [...] to do for you ? billymg (WoT: billymg) has a vtree and guide and Hannah Wiggins (WoT: hanbot), Aaron Rogier (WoT: BingoBoingo) and Eric Benevides (WoT: lobbes) have guides published. [↩] You probably [...]

    Reply
  4. Week 1 2020 Review - Wrestling With NSD After Standing Up TRB Nodes « Bingology - BingoBoingo's Blog says:
    January 5, 2020 at 10:57 p.m.

    [...] - Kansas, same low bidder operation 'anyserver' is provided [...]

    Reply

Leave a Reply

Click here to cancel reply.

 

It's still a pleasure to read bb prose. Both well researched and well written...

- Mircea Popescu

Recent Posts

  • Uruguay-SSR And The Hallucinated Seige
  • Introducing "The Montevideo Standard"
  • Qntra: A Plan For Action
  • A Homework Assignment From Diana_Coman: Trawling Ancient PMs Seeking What Worked For Early Qntra And Where I'm At On Scripting A Conversion Engine
  • Outreach Automation: A Call For Bids
  • Week 6 2020 Review - With Some Reflections On The Subject Of Feedback And Encountering Bots Blogging For Bots Nest
  • Photos From The Archives - January 20, 2011
  • Week 5 2020 Review - A Start To A Start
  • An Onramp For Contributing To Qntra - On Qntra
  • Week 4 2020 Review - Turning To Qntra

Recent Comments

  • Joe on Sports Team Fandoms as a Model Organism for Understanding Discourse
  • Alaskan Thunder Fuck on That One Agricultural Product And Uruguay
  • Aaron 'BingoBoingo' Rogier on Qntra: A Plan For Action
  • Aaron 'BingoBoingo' Rogier on Some FG Samples And Test Results
  • Mohammed nawar on Some FG Samples And Test Results
  • BetrugsRuehrerVow on Ceviche Theory And Practice
  • Aaron 'BingoBoingo' Rogier on Introducing "The Montevideo Standard"

Feeds

  • Posts RSS
  • Comments RSS


Tip Jar: 15eVXAW7k8uKc5moDFUSc9Y3jmHFAenNXo