Checking the status of prefork in Apache

It seems that prefork module is loaded, but the server MPM is empty.

# apache2ctl -M | grep prefork
 mpm_prefork_module (shared)
# apache2 -V | grep MPM
Server MPM:

Also, there is no library file for that.

# find /etc/apache2/ -name mod_mpm_prefork.so
#

and the content of mpm_prefork.conf is

# cat /etc/apache2/mods-available/mpm_prefork.conf
<IfModule mpm_prefork_module>
        StartServers                     5
        MinSpareServers           5
        MaxSpareServers          10
        MaxRequestWorkers         150
        MaxConnectionsPerChild   0
</IfModule>

So, am I using prefork module or not?

18.04 – Why is Apache being removed when I try to install curl?

I’m trying to install cURL and then php-curl on Ubuntu 18.04 but it removes Apache when I do this.

$  sudo apt install libcurl4 curl

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data libbrotli1 libonig2 libqdbm14 libssl1.0.2 php5-cli php5-json php5-readline
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  php7.2-fpm php7.4-fpm
The following packages will be REMOVED:
  apache2 apache2-bin libapache2-mod-php5 libapache2-mod-php7.2 libapache2-mod-php7.4 libcurl3 php5
The following NEW packages will be installed:
  curl libcurl4 php7.2-fpm php7.4-fpm
0 upgraded, 4 newly installed, 7 to remove and 12 not upgraded.
Need to get 3,191 kB of archives.
After this operation, 14.1 MB disk space will be freed.
Do you want to continue? [Y/n] y

What am I doing wrong here?

xsl fo – Can Apache FOP display RTL languages such as Hebrew with bullet-points and other content right aligned?

I’ve been struggling to understand how Apache FOP handles Hebrew, and potentially other rtl scripts.

When generating a document it appears to still leave the content as being left aligned including bullet points.

Image showing FOP output with bullet points and text left-aligned

I previously worked with Ibex in .Net which handled this FO file as expected.

Image showing Ibex output with bullet points and text right-aligned as expected

I had a look at some previous questions such as FOP apache – support Hebrew letters which helped find some of the Java/FOP specific changes needed and some routes I tried. The reference docs here https://xmlgraphics.apache.org/fop/2.2/complexscripts.html also had info on some tags to add which didn’t fix the issue, so I am hoping I just missed something obvious rather than this just not being possible in FOP.

Here’s a stripped back FOP I used in both processors with some Lorem Ipsum text:

<?xml version="1.0" encoding="UTF-16"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="core" page-height="297mm" page-width="210mm" margin-left="5mm"
                           margin-right="5mm" margin-top="9mm" margin-bottom="10mm">
      <fo:region-body region-name="Content" margin-left="5mm" margin-right="10mm" margin-top="10mm" margin-bottom="5mm"
                      column-gap="10mm" writing-mode="rl-tb" direction="rtl"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="core">
    <fo:flow flow-name="Content" font-family="Arial Unicode MS">
      <fo:block>
        <fo:block>קסאם מדינות מה. מיזם חשמל מיזמי רבה בה, לעריכת ופיתוחה פוליטיקה מתן מה:</fo:block>
        <fo:block>
          <fo:list-block>
            <fo:list-item>
              <fo:list-item-label end-indent="label-end()">
                <fo:block>●</fo:block>
              </fo:list-item-label>
              <fo:list-item-body start-indent="body-start()">
                <fo:block>קסאם מדינות מה. מיזם חשמל מיזמי רבה בה, לעריכת ופיתוחה פוליטיקה מתן מה.</fo:block>
              </fo:list-item-body>
            </fo:list-item>
          </fo:list-block>
        </fo:block>
      </fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

I’ve tried adding the <fo:bidi-override unicode-bidi="embed" direction="rtl"> node around the text but it seemed to make no difference in FOP, and wasn’t needed in ibex.

Adding language="hebr" script="he" to the page-sequence and flow nodes also made no difference.

The intention was to have FO files we could pass environmental variables into such as “rtl” and “rl-tb” (how this was handled with Ibex). If this can be achieved but we need two separate files for rtl and ltr that is always an option. Eventually this would be used for a variety of languages including Russian, Turkish, Korean etc so having one generic file would definitely be preferred!

apache 2.4 – Is there an official resource for httpd as opposed to apache2? Interested in differences between Ubuntu and RHEL

There are slight differences in the placement of files and directory structure even though by and large configuring virtual hosts and GIs is the same. Wondering if there is somewhere to refer to on those slight differences other than RHEL’s guides.

There is obviously Apache docs. Is there some subsection that talks about httpd in particular that i haven’t found yet?

Thank you.

ssl – Apache configuration priority with port 443

I have the configuration below for port 80 that is behaving as expected.

# conf below is prioritized and executed when
# vHost does not exist (acts as default)
#
<VirtualHost *:80>
    ...
</VirtualHost>

# conf below is prioritized and executed when
# vHost is example.com
#
<VirtualHost *:80>
    ServerName example.com
   ...
</VirtualHost>

However when applying the same for port 443 apache does not pick the block with the specified ServerName and execute it, instead, all HTTPS connections fail.

# I want to act as default when
# vHost does not exist
#
<VirtualHost *:443>
    ... kept empty to trigger error
</VirtualHost>

# and the conf below for example.com
#
<VirtualHost *:443>
    ServerName example.com
   ...
</VirtualHost>

In simple terms:

https://example.com -> should be served fine
https://sub.example.com -> should trigger error because vHost doesn't exist

Instead, both requests fail.

The SSL configuration is valid, commenting out the first block fixes the problem but doesn’t achieve the desired behavior as for port 80. This may have something to do with the fact that a secure connection needs to be established before transmitting data, but then how apache can pick the right <VirtualHost *:443> configuration when there are 2 or more vHosts, each identified by its own ServerName, but fails in this case.

apache – how to turn off localhost server

I’ve discovered by accident that my Mac is running a localhost web server. I typed “localhost” into Safari and got “It works!”

My question is: How do I turn this thing off? I’ve tried things like this:

$ sudo apachectl stop

And

$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

But this changes nothing, and the Terminal complains

/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service

request smuggling – Force Apache Server/Tomcat to ignore Transfer-Encoding

I am trying to reproduce HTTP request smuggling using an Apache HTTP Server as a reverse proxy (using mod_proxy) and a Tomcat Server in the back-end.

Is it possible to force either Apache Server or Tomcat to ignore Transfer-Encoding in requests (and only use Content-Length)? Or is request smuggling simply not possible with this configuration?

apache – Ruby is starting httpd, and I can’t find where from

OSX 10.15.5. Mac Mini. Homebrew httpd and hopefully OSX httpd disabled in plist but something is still starting this I have the plist for apache/httpd disabled, but on reboot I still get this

  231 ??         0:00.08 /usr/bin/ruby /usr/sbin/httpd-wrapper -D FOREGROUND
 1258 ??         0:00.42 /usr/sbin/httpd -D FOREGROUND
 1262 ??         0:00.00 /usr/sbin/httpd -D FOREGROUND```

and so on.
I can’t find a way to stop it loading. How do I find what is starting this process? I don’t recall ever seeing it started with ruby before? It’s not in the list file even?

storage – Looking for architecture recommendations/critique: locally hosted neo4j db + django application on apache server

We would like to develop an application for analyzing ribosomes, which will both require some local data and yield a lot of new data as well, be quite computationally demanding. Because the types of biological data that we work with are highly unstructred and often poorly integrated, i decided to use Neo4j graph-database in production.

I am planning to host it on our university’s rack which should also make all the compute necessary for parsing and clustering readily and locally available. One issue i see ahead is the fact that some of the crystallographic files that we use as the basis for our computations are quite large (on the order of 100mb) and come in multiple formats (ex..pdb,.cif). The closest that Neo4j has to this is geo-spatial 3D Point type, but other than that it does not support this sort of storage.

Hence, it seems like the optimal thing is to commit all the string/int non-structural data to the database and store the .cif files locally in the server’s filesystem. Then, when the user queries the front-end for something, have the Django app parse the large local file and pull the necessary nomenclature/identifiers from Neo4j, respond with the result.

I have however read a few “database vs file storage” discussions and articles and decided to ask what pitfalls are there for something like this and if there is a better solution/architecture that i’m not seeing?

Thanks!

ubuntu – My site has stopped working (Cloudflare 522 error), minimal server load (Nginx + Apache + WordPress)

I run multiple websites being served on a stand alone Ubuntu machine, all of them use same nginx + apache setup.
However one of these sites has begun to act very strangely today.
It’s the only site on the server that uses Cloudflare, and on several occasions today the site has failed to load for periods of 30-60 minutes (like this – https://bobcares.com/wp-content/uploads/cloudflare_error_522_connection_timed_out.png), before recovering.
Often a page on the site would load albeit incredibly slowly, as if the speed was capped to a few kBps. Pages would take several minutes to load and some of the resources would fail to load.

I first noticed the issue earlier today when it was reported by a user. I did nothing on the server end beside check the server load via ssh and check my webserver logs, and within 30 minutes it had resolved.
Since then the same issue has re-occurred several more times for 30-60 minutes at a time, before mysteriously resolving and I have no idea why.

On each occasion there was not an excessive amount of requests being channelled through the site, there was very little in my processes taking up resources on the server.

If there was anything wrong with my server setup beneath the webserver then it would have affected my other sites’ performance, but it was just this one site that was repeatedly having issues, and will probably continue to.
And my server has remained relatively unchanged recently.

Any ideas how I can diagnose this problem? So far I have found nothing wrong, but then again I have done no alterations to the server recently.
I’ve tried everything I know besides rebooting the server as I want to get to the bottom of this.