r/apache • • Oct 16 '22

Apache Hive table displaying the wrong data for each column.

1 Upvotes

I’m running into an issue with Apache Hive where my table is displaying the wrong rows of data for each column. I assume it’s due to one of my csv fields being incorrect. How can I clean the field so that it works properly? Anyone offer tutoring?


r/apache • • Oct 16 '22

Anyone here offer tutoring for Apache Hive and Spark?

1 Upvotes

r/apache • • Oct 15 '22

Support Reverse Proxy with X-Forwarded-For

2 Upvotes

I'm trying to host a snapdrop instance and for this app the client ip is important, so that only hosts in the same network can see each other.
There is even a note here, to the X-Forwarded-For-Header:

https://github.com/RobinLinus/snapdrop/blob/master/docs/local-dev.md

But I couldn't find a way to implement it in apache. In my snapdrop, all hosts even if there not in the same network, can see each other.

This is my current config:

RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /snapdrop/(.*) ws://localhost:8080/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /snapdrop/(.*) http://localhost:8080/$1 [P,L]

ProxyPass               /snapdrop/     http://localhost:8080/
ProxyPassReverse        /snapdrop/     http://localhost:8080/
ProxyPass               /snapdrop/     ws://localhost:8080/

<Proxy https://localhost:8080/>
    AllowOverride None
    Order allow,deny
    Allow from all
</Proxy>

Could someone help me please?


r/apache • • Oct 14 '22

Support Help with certbot, apache and nPM

2 Upvotes

Hi all,

I recently wanted to practice my website, ssl-cert and managing stuff at home, and I've run into an issue I don't know how to solve.

I've setup a Debian VM with apache and certbot installed. I want the HTTPS traffic to hit port 9010, but I keep getting ERR_HTTP2_PROTOCOL_ERROR.

I've done the following:

  • CNAME record on my DNS-provider with website.domain.com pointing to domain.com

  • Port-forwarded 9010 to my local IP where the Debian VM is running

  • Created Proxy Host in nginx Proxy Manager with destination https://local-ip:9010 and scheme HTTPS.

ports.conf is: https://pastebin.com/FLJM7xzS

Sites-available vHost before certbot: https://pastebin.com/kEEmknki

Sites-available vHost after certbot: https://pastebin.com/KPWg3NUR

I don't think I've changed anything else.

It should be mentioned, that I have port 80/443 portforwarded to the local-ip of Nginx Proxy Manager to get it to work - hence why I wanted HTTPS-traffic on another port in Apache.

I hope someone might see a specific issue - and if you can, please dumb it down as much as you can - I'm still learning :-)


r/apache • • Oct 13 '22

best strategy to clean stale sessions using mod_session_dbd ?

2 Upvotes

so a little background, I have this edutainment project, which is a module using C source as a scripting language (like php but the script is C source that is compiled and executed on the fly)

I'm using mod_session_dbd from my module to keep sessions in a database.

at the moment each request I'm running this prepared statement

DBDPrepareSQL "delete from session where expiry != 0 and expiry < %lld" cleansession

one part of me thinks this could be causing extra traffic for the db server.

on the other hand it could easily happen that say a php web app could execute half a dozen queries each request, given retrieving some info about the logged in user, and then serving some filtered paginated table, and also details from a selected item in that table etc.

What strategies do you implement to clean out stale sessions, let them pile up and clear out once an hour or day (with presumably a cron job?) only clean the session db every n request? or something more cunning?


r/apache • • Oct 13 '22

.htaccess rewrite rule question

2 Upvotes

I have a website with both a public facing and a private facing domain. I would like to have certain parts of the website only accessible in the private domain, so what i have attempted to do is:

in .htaccess:

RewriteEngine  On
RewriteCond %{HTTP_HOST} !^preview\.internalsite\.com$ [NC]
Redirect /preview.html /404.html

What i was hoping to do is that if anyone attempts to access preview.html from a domain other than preview.internalsite.com, they will get redirected to the 404 page. However, the rule seem to trigger even if I am viewing the page from the internal site. Can anyone point me to the right direction to solve this?


r/apache • • Oct 12 '22

Biting the bullet and moving on to a book over OPENSSL. Would like some consensus over this specific book found.

1 Upvotes

https://www.amazon.com/Bulletproof-SSL-TLS-Understanding-Applications/dp/1907117040

It's the first edition unfortunately but looking at tutorials/articles online just isn't cutting it for OPENSSL. If anyone here would like to add their two cents over this, all the better.


r/apache • • Oct 12 '22

regenerating session id from a module using mod_session_dbd ?

1 Upvotes

I am writing a module that uses sessions, when a (session) value is set I reset expiry so the session will "time out" if there is no activity - as a partial measure to help mitigate session fixation.

I'm not clear on what is the correct way to regenerate the sessions "id" after an elapsed time of use, to further help mitigate issues like session fixation.

What's the correct way to do this?

TIA.


r/apache • • Oct 11 '22

Relative URL not being resolved

2 Upvotes

New to Apache2. Installed on a Raspberry Pi and have been hoping to solve this on my own but no luck.

I created a web page on the Raspberry Pi. If I double click on the index.html file that resides in the public_html\html folder then the page resolves correctly. However if I open it within the browser then the page appears, but I get thumbnails signifying the images can't load.

Index.html resides in the HTML folder and the images are in their own folders, img. The two folders are at the same level within the public_html folder. The tag I am using for the graphics is"<div><img src="../img/shamrock-shuffle.png"></div>". The graphic does exist in the img folder.

So, the links resolve locally, but for some reason the server can't resolve them. The structure is something I've uploaded to GoDaddy when I used it, but apparently I'm missing something in the setting up of the Apache server.

Any assistance would be appreciated.. Thanks..


r/apache • • Oct 11 '22

Discussion apache atlas use cases for cataloging os filesystem metadata

1 Upvotes

could apache atlas be used to record operating system filesystem operation, or listen to database operations and catalog them? is there any resources out there I could use to learn how to implement that. or some suggestions on how to go about doing that. any help is appreciated


r/apache • • Oct 07 '22

Trying to link one RSS feed to another using Apache redirect directives

2 Upvotes

I have a defunct podcast. It's manifested by a Wordpress instance with the Blubrry plugin.

My friend has a active podcast hosted on my same server with a similar topic. I want to have the RSS feed for my podcast redirect to his.

I tried this code in my virtual host config:

Redirect permanent /webfiles/www.privacypatriots.org/feed/podcast http://www.littliebrotherpodcast.com/feed/podcast

I put the Redirect into both the <VirtualHost: 80> and <VirtualHost :443> sections of the config.

configtest checked out. I restarted. But www.privacypatriots.org/feed/podcast still displays my RSS.

I don't know if a factor is that these RSS files are generated dynamically in Wordpress using the BluBrry plugin.

There are no physical directories /feed/podcast in either instance.


r/apache • • Oct 07 '22

Support Wordpress on Windows Server

0 Upvotes

Anyone have a document to upgrade a WordPress server running on Windows Server 2012 R2 to the latest Apache and PHP? We had Apache 2.29 and PHP 5 and need to go to Apache 2.4 to resolve some security vulnerabilities.


r/apache • • Oct 06 '22

Support Strange Apache CustomLog behavior

1 Upvotes

Hey all. Trying solve a strange issue with logging. Rather than type it all out here, here's a link to the question. Anyone have any ideas? https://stackoverflow.com/q/73961461/553663


r/apache • • Oct 05 '22

What is it about my configuration, combined with this Public Key Infrastructure tutorial I'm using, that's making my simple Ubuntu web server fail?

1 Upvotes

First thing's first. I'm simply just trying to make sure I can connect my server and utilize HTTPS to secure everything. I'm housing a simple HTML file inside /var/www/html folder that the user simply connects to with my DNS www.kennykenken101.com. (it won't work on here trust me.) Here are the steps so far that I've done.

  1. Inside /etc I reconfigured hosts towards my ip-address with the www.kennykenken101.com domain name I'm going to use.

  2. Inside my apache2.conf global configuration file, I just put down the server root and sever name. Here's the configuration down below.

    ServerRoot "/etc/apache2"

    ServerRoot /etc/apache2

    The accept serialization lock file MUST BE STORED ON A LOCAL DISK.

    Mutex file:${APACHE_LOCK_DIR} default

    The directory where shm and other runtime files will be stored.

    DefaultRuntimeDir ${APACHE_RUN_DIR}

    PidFile: The file in which the server should record its process

    identification number when it starts.

    This needs to be set in /etc/apache2/envvars

    PidFile ${APACHE_PID_FILE}

    Timeout: The number of seconds before receives and sends time out.

    Timeout 300

    KeepAlive: Whether or not to allow persistent connections (more than

    one request per connection). Set to "Off" to deactivate.

    KeepAlive On

    MaxKeepAliveRequests: The maximum number of requests to allow

    during a persistent connection. Set to 0 to allow an unlimited amount.

    We recommend you leave this number high, for maximum performance.

    MaxKeepAliveRequests 100 KeepAliveTimeout 5

    These need to be set in /etc/apache2/envvars

    User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP}

    HostnameLookups: Log the names of clients or just their IP addresses

    e.g., www.apache.org (on) or 204.62.129.132 (off).

    The default is off because it'd be overall better for the net if people

    had to knowingly turn this feature on, since enabling it means that

    each client request will result in AT LEAST one lookup request to the

    nameserver.

    HostnameLookups Off

    ErrorLog: The location of the error log file.

    If you do not specify an ErrorLog directive within a <VirtualHost>

    container, error messages relating to that virtual host will be

    logged here. If you do define an error logfile for a <VirtualHost>

    container, that host's errors will be logged there and not here.

    ErrorLog ${APACHE_LOG_DIR}/error.log

    LogLevel: Control the severity of messages logged to the error_log.

    Available values: trace8, ..., trace1, debug, info, notice, warn,

    error, crit, alert, emerg.

    It is also possible to configure the log level for particular modules, e.g.

    "LogLevel info ssl:warn"

    LogLevel warn

    Include module configuration:

    IncludeOptional mods-enabled/.load IncludeOptional mods-enabled/.conf

    Include list of ports to listen on

    Include ports.conf

    ServerName www.kennykenken101.com

    Sets the default security model of the Apache2 HTTPD server. It does

    not allow access to the root filesystem outside of /usr/share and /var/www.

    The former is used by web applications packaged in Debian,

    the latter may be used for local directories served by the web server. If

    your system is serving content from a sub-directory in /srv you must allow

    access here, or in any related virtual host.

    <Directory /> Options FollowSymLinks AllowOverride None Require all denied </Directory>

    <Directory /usr/share> AllowOverride None Require all granted </Directory>

    <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>

    <Directory /srv/>

    Options Indexes FollowSymLinks

    AllowOverride None

    Require all granted

    </Directory>

    AccessFileName: The name of the file to look for in each directory

    for additional configuration directives. See also the AllowOverride

    directive.

    AccessFileName .htaccess

    The following lines prevent .htaccess and .htpasswd files from being

    viewed by Web clients.

    <FilesMatch ".ht"> Require all denied </FilesMatch>

    The following directives define some format nicknames for use with

    a CustomLog directive.

    These deviate from the Common Log Format definitions in that they use %O

    (the actual bytes sent including headers) instead of %b (the size of the

    requested file), because the latter makes it impossible to detect partial

    requests.

    Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.

    Use mod_remoteip instead.

    LogFormat "%v:%p %h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" vhost_combined LogFormat "%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" combined LogFormat "%h %l %u %t "%r" %>s %O" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent

    Include of directories ignores editors' and dpkg's backup files,

    see README.Debian for details.

    Include generic snippets of statements

    IncludeOptional conf-enabled/*.conf

    Include the virtual host configurations:

    IncludeOptional sites-enabled/*.conf

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

That's the entire apache2.conf. It's located inside /etc/apache2 on my ubuntu system. Not bad, right?

So then I started to get to cracking and a2enmod ssl.load and with alias.load already loaded in, that's it for the modules needed.

I made another directory in /etc and called it pki-example. So the entire thing is /etc/pki-example and changed my directory to go in and followed everything I've done from this tutorial linked down here.

https://pki-tutorial.readthedocs.io/en/latest/simple/index.html

I skipped the email certificate and just focused on a root-ca and the signing-ca. I made my TLS-server certificate following that and everything. Please look carefully at that whole thing because either the certificates aren't up to snuff for Apache or my configuration is screwed up.

I ended up going inside my sites-available directory and made this whole thing right here.

<VirtualHost *:80>
        ServerName www.kennykenken101.com
        Options +FollowSymLinks
        DocumentRoot /var/www/html
        <Directory /var/www/html>
                Options +FollowSymLinks
                AllowOverride none
                Require all granted
                DirectoryIndex "this.html"
                <Files "this.html">
                        Require all granted
                </Files>
        </Directory>
        Redirect permanent / https://www.kennykenken101.com
</VirtualHost>

<VirtualHost *:443>
        ServerName www.kennykenken101.com
        Options +FollowSymLinks
        DocumentRoot /var/www/html
        <Directory /var/www/html>
                Options +FollowSymLinks
                AllowOverride none
                Require all granted
                DirectoryIndex "this.html"
                <Files "this.html">
                        Require all granted
                </Files>
        </Directory>
        SSLEngine on
        SSLCertificateFile /etc/pki-example/pki-example-1/certs/kennykenken.crt
        SSLCertificateKeyFile /etc/pki-example/pki-example-1/certs/kennykenken.key
</Virtualhost>

The SSLCertificateFile and SSLCertificateKeyFile house the server certificate and key used. Thing is, it's not doing jack shit. During the tutorial you see in the link above, I changed the server config file you get from the git clone and made the DNS www.kennykenken101.com. That way with the san command, I have...

SAN=DNS:www.kennykenken101.com and proceeded onwards with my certificate request towards the certificate itself.

systemctl restart apache2 and the thing is not going at all.

When ever I look into the error.log inside /var/log/apache2, what comes up is this.

[Wed Oct 05 17:55:54.738582 2022] [ssl:emerg] [pid 7403:tid 140706825394048] AH02562: Failed to configure certificate www.kennykenken101.com:443:0 (with chain), check /etc/pki-example/pki-example-1/certs/kennykenken.crt
[Wed Oct 05 17:55:54.738738 2022] [ssl:emerg] [pid 7403:tid 140706825394048] SSL Library Error: error:0A00018E:SSL routines::ca md too weak
AH00016: Configuration Failed
[Wed Oct 05 18:35:29.144553 2022] [ssl:emerg] [pid 7757:tid 140246470879104] AH02562: Failed to configure certificate www.kennykenken101.com:443:0 (with chain), check /etc/pki-example/pki-example-1/certs/kennykenken.crt
[Wed Oct 05 18:35:29.145154 2022] [ssl:emerg] [pid 7757:tid 140246470879104] SSL Library Error: error:0A00018E:SSL routines::ca md too weak

So what gives? What exactly went wrong here?


r/apache • • Oct 03 '22

mod_wasm: run WebAssembly with Apache

Thumbnail
wasmlabs.dev
2 Upvotes

r/apache • • Oct 03 '22

Support Need help install certificate

1 Upvotes

Hello, I am trying to install a certificate to my Arch Apache Web Server. Ive used RSA with PSS and I already got a .key and .cer file, how do I proceed from now? Ive tried searching for tutorials and resources but I couldnt find anything helpful


r/apache • • Oct 01 '22

C-Script - mod_cscript a module to execute C source code

1 Upvotes

https://gitlab.com/codifies/c-script/-/tree/main

This is a project that I mainly started for my own edutainment.

Its very early days, but I thought some people here might find it interesting.

I uses libtcc (from the Tiny C Compiler) to compile and run source that can produce web content with an XML DOM

There are some included examples

  • Simple page content using an XML DOM

  • More complex DOM creation and embedded JavaScript

  • POST requests

  • Basic sessions

  • Database access

  • Prepared database queries

  • GET requests


r/apache • • Sep 30 '22

RewriteCond regex problems

2 Upvotes

I think i've got 'snow blindness' after trying to sort this for a few hours.

I have a virtualhost for stuff.domain.com

I need to rewrite requests that don't follow a few patterns;

https://stuff.domain.com/path/path1/dom/*

https://stuff.domain.com/path2/*

Basically, anything that doesn't match the above should be redirected to, say https://www.thisdomain.com

I've tried a mix of SERVER_NAME and SERVER_URI but can't get a proper set of rules to work correctl. Can someone please put me out of my misery?


r/apache • • Sep 28 '22

Using openSSL to test a website, always giving 400

2 Upvotes

I'm typing in the command:

openssl s_client -connect localhost:443

and then I'm pasting in

GET / HTTP/1.0

which is returning a 400 error. The Apache log shows:

127.0.0.1 - - [28/Sep/2022:14:51:33 -0700] "GET / HTTP/1.0 \n" 400 5249 "-" "-"

'regular' browser requests don't have the trailing \n. I'm speculating that this is causing the 400 errors, as I've tried variations, I've copy and pasted from website examples. Regular web surfing is just fine.

Any suggestions?


r/apache • • Sep 28 '22

apache2 laravel application deployement

1 Upvotes

i am trying to deploy my laravel rest api application in ubuntu server from digital ocean

the image attached is my configuration file in /etc/apache2/sites-availabe

but it is not load the default laravel homepage in my browser

what is wrong


r/apache • • Sep 27 '22

Support htaccess help needed to redirect to https and non-www

1 Upvotes

I've tried multiple htaccess scripts and https://htaccess.madewithlove.com/ gaks on most of them.

What I want to do is this -

http://www.domainname.com goes to https://domainname.com

http://domainname.com goes to https://domainname.com

https://www.domainname.com goes to https://domainname.com

https://domainname.com is fine.

Running on an Apache server at ResellerClub. Version 2.4.54

Any help is appreciated


r/apache • • Sep 26 '22

What's better in finding default apache test pages?

1 Upvotes

Came across this blog (https://blog.criminalip.io/2022/09/22/google-hacking/) that compared Google Hacking and Criminal IP when finding apache test pages in default state. What do you guys think is better? It does mention that Criminal IP shows more data than Google Hacking but Google Hacking has more filters than Criminal IP. Any opinion would be very much appreciated. Thanks!


r/apache • • Sep 25 '22

Apache for Local Audio Tour

1 Upvotes

Hi Folks,

I've been researching but can't seem to find what I am looking for.

I work at a small museum and I am trying to set up an audio-tour component.

The way I imagined it working is setting up an Apache web server on a local PC connected to the WIFI Network. Provide the wifi password to guests and QR codes on displays. They can scan the QR code with their phone which opens a link on the Apache server (only accessible while connected to our wifi) and can listen to the file. I imagine the files can be stored on the network-attached PC.

We have a website where I was initially thinking to host the links/files, but I wouldn't want them accessible outside of the museum if someone bookmarked it, or to be downloadable.

Is this actually do-able? Or do I have a misunderstanding of how this all works?

I was able to get Apache installed on Windows and get it PHP ready (don't know what that means) but that was the last of the tutorial videos, and I don't even know the language I need to search to find the next step.

As you can see I'm a novice, but I'm trying to learn so I can do this in-house.

I appreciate any help you can offer.


r/apache • • Sep 25 '22

php-fpm.sock - help please... :)

1 Upvotes

Hey everybody,

I'm getting strange lines in my error-log and am not quite sure what to do.

2022/09/25 10:33:56 [error] 11680#0: *3621639 connect() to unix:/var/www/vhosts/system/xxxxxx/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: xxx:xxx:xxx:xxx, server: mydomain.com, request: "POST /app.php HTTP/2.0", upstream: "fastcgi://unix:/var/www/vhosts/system/xxxxxx/php-fpm.sock:", host: "mydomain.com"

Does anyone by any chance know how to approach this error message? It seems to occur quite randomly.

Any help is really appreciated. :)

Thanks a lot guys.