apache – .htaccess is overwritten each time it is edited

I installed Drupal 8.7.5 and chose "Standard" during the installation.

The .htaccess file is rewritten each time the content changes.
It is located in Drupal-8.7.5 / sites / default / files /.

I can not even change this file because it is not read-only. If I rename it, it will be rewritten.

How do I

  1. do not let Drupal overwrite the file, or
  2. change the content of this .htaccess file?

I have now edited core / lib / Drupal / Component / PhpStorage / FileStorage.php
and changed there what is written on .htaccess. I think it's a mistake to hard-code things like that in a PHP source file.

Better solution: First delete drupal-8.7.5 / sites / default / files / .htaccess (read-only) and then upload a new .htaccess file. Why is it readonly?

Java – Do you handle exceptions when reading Excel data with Apache POI?

I have the following code that works, but I'm not happy with it and it seems like an ugly hack.

NppColumn is an enumeration that contains the column indexes. The problem is when a POI line can not be stored in the vehicle object and a class transformation exception is thrown. I want to know which column caused this so I can alert the user to the cause of the error. I do not like many things about the code.

  • The switch statement is big and ugly.
  • At first I thought the enumeration was a good idea, so we can easily change which column contains which value, but now I'm not so sure.
  • Intercepting the runtime exception and setting the error messages for the vehicle object seems to be wrong.
  • Much code seems to be superfluous.
Private vehicle convertPoiRowToVehicle (Row inputPoiRow) {
Vehicle vehicle = new vehicle ();

for (NppColumn nppColumn: NppColumn.values ​​()) {
int index = nppColumn.getValue ();

Cell currentCell = inputPoiRow.getCell (index, Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);

if (currentCell! = null) {

switch (nppColumn) {
Case ECS:
To attempt {
String cellValue = currentCell.getStringCellValue ();
vehicle.seteConstructionSeries (cellValue);
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("E Construction Series has a formatting error");
}
break;
Suitcase ENGINE:
To attempt {
vehicle.setEngine (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("Engine has a formatting error");
}
break;
Housing MODEL:
To attempt {
vehicle.setModel (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("model has a formatting error");
}
break;
Case CVS:
To attempt {
vehicle.setCountry_version (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("A formatting error occurred in the country version");
}
break;
Case STG:
To attempt {
vehicle.setSteering (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("Streering has a formatting error");
}
break;
case MODEL_CODE_2:
To attempt {
vehicle.setModelcode (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("model code 2 has a formatting error");
}
break;
case TRIM_LEVEL:
To attempt {
vehicle.setTrimLevel (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("Trim Level has a formatting error");
}
break;
Case L_02:
To attempt {
vehicle.setRegionLevel2 (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("Region Level 2 has a formatting error");
}
break;
Suitcase PLU:
To attempt {
vehicle.setPlanningUnit (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("Planning Unit has a formatting error");
}
break;
case PRICE_STATUS:
To attempt {
Object priceStatus = getValueForDateColumn (currentCell);
vehicle.setPriceStatus ((LocalDate) priceStatus);
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("price status has a formatting error");
}

break;
case CURRENCY:
To attempt {
vehicle.setCurrency (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("Currency has a formatting error");
}
break;
case PRICE:
To attempt {
String priceValue = currentCell.getStringCellValue ();
priceValue = priceValue.replace (".", "");
priceValue = priceValue.replace (",", ".");
BigDecimal bigDecimalPrice = new BigDecimal (priceValue);
vehicle.setPrice (bigDecimalPrice);
} catch (NumberFormatException e) {
vehicle.getValidationErrors (). add ("price has a formatting error");
}

break;
Case Status:
To attempt {
vehicle.setStatus (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("Status has a formatting error");
}
break;
Case COMMITTEE:
To attempt {
vehicle.setCommittee (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("scrap has a formatting error");
}
break;
case COMMITTEE_DATE:
To attempt {
Object committeeDate = getValueForDateColumn (currentCell);
vehicle.setCommitteeDate ((java.sql.Date) committeeDate);
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("scrap date has a formatting error");
}
break;
case SYNCHRO_POINT:
To attempt {
vehicle.setSynchroPoint (currentCell.getStringCellValue ());
} catch (ClassCastException e) {
vehicle.getValidationErrors (). add ("Syncro Point has a formatting error");
}
break;

}
}

}
Return vehicle;
`` `

Optimize Apache | Web Hosting Talk

Quote Quote by Serper
Show contribution
Hello Gyus

In addition to an application: /mysqltuner.pl for optimizing MySQL, there is an application for:

* Optimize Apache?
* Optimize PostgreSQL?
* Optimize / secure cPanel?

The basis for optimizing MySQL:

Code:

[mysqld]



max_connections = 400
max_user_connections = 200
key_buffer = 16M
myisam_sort_buffer_size = 32M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1024
thread_cache_size = 286
interactive_timeout = 25
wait_timeout = 1000
connect_timeout = 10
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 1 million
query_cache_size = 16 million
query_cache_type = 1
tmp_table_size = 16M
Skip-innodb

[mysqld_safe]
open_files_limit = 8192

[mysqldump]
fast
max_allowed_packet = 16M

[myisamchk]
key_buffer = 32M
sort_buffer = 32M
read_buffer = 16M
write_buffer = 16M

This is for 512 MB. Then change the parameters as needed.

Optimize Apache:

– Disable unneeded modules
– Switch to MPM Event

https://asysadmin.tips/tuning-apache…affic-website/

Secure cPanel:

RSA 4096
https://forums.cpanel.net/resources/…hardening.419/
https://documentation.cpanel.net/dis…omb+Protection
Enable cPHulk Brute Force Protection
Install the CSF firewall
Install Maldet, ClamAV …

Configuration CSF:

Create csf-config.sh

Code:

#! / bin / bash

/ bin / sed -i "s / RESTRICT_SYSLOG  s * =. * $ / RESTRICT_SYSLOG = " 3  "/ g" /etc/csf/csf.conf
/ bin / sed -i "s / SYSLOG_CHECK  s * =. * $ / SYSLOG_CHECK = " 3600  "/ g" /etc/csf/csf.conf
/ bin / sed -i "s / SMTP_BLOCK  s * =. * / SMTP_BLOCK = " 1  "/ g" /etc/csf/csf.conf
/ bin / sed -i "s / LF_GLOBAL  s * =. * $ / LF_GLOBAL =" 1800  "/ g" /etc/csf/csf.conf
/ bin / sed -i "s / GLOBAL_ALLOW  s * =. * $ / GLOBAL_ALLOW =" http:  /  / git  .buyscripts  .in : 10080  / boby  / firewall  / raw  / master  / allow  .txt  "/ g" /etc/csf/csf.conf
/ bin / sed -i "s / GLOBAL_DENY  s * =. * $ / GLOBAL_DENY =" http :  /  / git  .buyscripts  .in: 10080  / boby  / firewall  / raw  / master  /deny.txt  "/ g" /etc/csf/csf.conf

# This option notifies you when a large amount of e-mail is sent from a particular script on the server
/ bin / sed -i "s / LF_SCRIPT_ALERT  s * =. * $ / LF_SCRIPT_ALERT = " 1  "/ g" /etc/csf/csf.conf

# This option ensures that almost all Linux accounts are checked by Process Tracking, not just the cPanel accounts
/ bin / sed -i "s / PT_ALL_USERS  s * =. * $ / PT_ALL_USERS = " 1  "/ g" /etc/csf/csf.conf

/ bin / sed -i "s / TESTING =" 1 "/ TESTING =" 0 "/ g" /etc/csf/csf.conf

/ bin / systemctl Restart of csf.service

Config cPanel:

Code:

#! / bin / bash

# WHM optimizations for a better CSF rating

# Disable SMTP restrictions. WHM> Security Center> SMTP Restrictions
/ bin / sed -i "s / ^ smtpmailgidonly = 1 $ / smtpmailgidonly = 0 / g" /var/cpanel/cpanel.config

# Check if the cPanel login is SSL only. WHM> Optimize settings> Always redirect to SSL
# / bin / sed -i "s / ^ alwaysredirecttossl = 0 $ / alwaysredirecttossl = 1 / g" /var/cpanel/cpanel.config

# Check if BoxTrapper is disabled under WHM> Customize Settings> BoxTrapper Spam Trap
/ bin / sed -i "s / ^ skipboxtrapper = 0 $ / skipboxtrapper = 1 / g" /var/cpanel/cpanel.config

# Max hourly emails per domain. WHM> Optimize settings> Maximum number of hourly emails per domain
/ bin / sed -i "s / ^ maxemailsperhour $ / maxemailsperhour = 150 / g" /var/cpanel/cpanel.config

# Disable password reset for cPanel accounts. WHM> Customize settings> Reset password for cPanel accounts
/ bin / sed -i "s / ^ resetpass = 1 $ / resetpass = 0 / g" /var/cpanel/cpanel.config

# Disable resetting the password for subaccounts. WHM> Customize settings> Reset password for subaccounts
/ bin / sed -i "s / ^ resetpass_sub = 1 $ / resetpass_sub = 0 / g" /var/cpanel/cpanel.config

# Check the proxy subdomains. WHM> Customize Settings> Proxy Subdomains
/ bin / sed -i "s / ^ proxysubdomains = 1 $ / proxysubdomains = 0 / g" /var/cpanel/cpanel.config

# Check the accounts that can access a cPanel user. You should consider setting this option to "User" after use. WHM> Customize settings> Accounts that can access a cPanel user account
/ bin / sed -i "s / ^ account_login_access = owner_root $ / account_login_access = user / g" /var/cpanel/cpanel.config

# Enable Referrer Blank Security. WHM> Tweak Settings> Blank Referrer Security Check
/ bin / sed -i "/ ^ referrerblanksafety = 0 $ / referrerblanksafety = 1 / g" /var/cpanel/cpanel.config

# Enable referrer security. WHM> Customize Settings> Referrer Security Check
/ bin / sed -i "s / ^ referrersafety = 0 $ / referrersafety = 1 / g" /var/cpanel/cpanel.config

# Check the ENV variable for the password. WHM> Customize settings> Hide logon password in CGI scripts
/ bin / sed -i "s / ^ cgihidepass = 0 $ / cgihidepass = 1 / g" /var/cpanel/cpanel.config

# Original standard / bulk forwarding destination
/ bin / sed -i "s / ^ defaultmailaction =. * $ / defaultmailaction = blackhole / g" /var/cpanel/cpanel.config

# Set time zone to UTC

rm -f / etc / localtime
ln -s / usr / share / zoneinfo / UTC / etc / localtime

# only enable awstats

echo "DEFAULTGENS = AWSTATS"> /etc/stats.conf
echo "allow_awstats_include = 0" >> /etc/stats.conf

/ bin / sed -i "s / ^ skipanalog = 0 / skipanalog = 1 / g" /var/cpanel/cpanel.config
/ bin / sed -i "s / ^ skipwebalizer = 0 / skipwebalizer = 1 / g" /var/cpanel/cpanel.config

/ scripts / initquotas

/ scripts / install_lets_encrypt_autossl_provider

wget https://gist.githubusercontent.com/serverok/dd123d2a79a7490a8d4cca0e6ba47bff/raw -O /var/cpanel/autossl.json

# Keep Cpanel logs

mkdir / root / cpanel3-skel /
echo "archive-logs = 1"> /root/cpanel3-skel/.cpanel-logs
echo "remove-old-archived-logs = 1" >> /root/cpanel3-skel/.cpanel-logs

# Disable mail from the mailer daemon

/ bin / sed -i's / mailer-daemon:  tpostmaster / mailer-daemon:  / dev  / null / g "/ etc / aliases

# Install Clamav

/ scripts / update_local_rpm_versions --edit target_settings.clamav installed
/ scripts / check_cpanel_rpms --fix --targets = clamav

Restart of the service panel

# Activate the grenade guard

/ usr / local / cpanel / bin / install-login-profile --install limits

passwords:

Code:

Echo "--- Setting password policies ---"
echo "--- By recommendation from http://wiki.centos.org/HowTos/OS_Protection ---"
echo "------------------------------------------------ ---------------------------- "
echo "passwords expire every 180 days"
perl -npe's / PASS_MAX_DAYS  s + 99999 / PASS_MAX_DAYS 180 / & # 39; -i /etc/login.defs
echo "Passwords may only be changed once a day"
perl -npe's / PASS_MIN_DAYS  s + 0 / PASS_MIN_DAYS 1 / g & # 39; -i /etc/login.defs

Block frequent attacks

Code:

echo "--- block frequent attacks ---"
Echo "-------------------------------"

echo "Force SYN packet check"
/ sbin / iptables - ENTER - p tcp! --syn -m state --state NEW -j DROP

echo "Force Fragments - Package Check"
/ sbin / iptables -A ENTER -f -j DROP

echo "Discarding Malformed XMAS Packages"
/ sbin / iptables -A ENTER -p tcp --tcp-flags ALL FIN, PSH, URG -j DROP

echo "Discard all NULL packages"
/ sbin / iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP

echo "Limit pings to 1 per second"
/ sbin / iptables -N PACKET
/ sbin / iptables -A DEFAULT_RULES -p icmp -m limit --limit 3 / sec --limit-burst 25 -j ACCEPT

Echo "Setup Connection Tracking"
/ sbin / iptables -N STATE_TRACK
/ sbin / iptables -A STATE_TRACK -m state --state RELATED, ESTABLISHED -j ACCEPT
/ sbin / iptables -A STATE_TRACK -m state --state INVALID -j DROP

Echo "discourage port scanning"
/ sbin / iptables -N PORTSCAN
/ sbin / iptables -A PORTSCAN -p tcp --tcp flags ACK, FIN FIN -j DROP
/ sbin / iptables -A PORTSCAN -p tcp --tcp flags ACK, PSH PSH -j DROP
/ sbin / iptables -A PORTSCAN -p tcp --tcp flags ACK, URG URG -j DROP
/ sbin / iptables -A PORTSCAN -p tcp --tcp flags FIN, RST FIN, RST -j DROP
/ sbin / iptables -A PORTSCAN -p tcp --tcp flags SYN, FIN SYN, FIN -j DROP
/ sbin / iptables -A PORTSCAN -p tcp --tcp flags SYN, RST SYN, RST -j DROP
/ sbin / iptables -A PORTSCAN -p tcp --tcp-flags ALL ALL -j DROP
/ sbin / iptables -A PORTSCAN -p tcp --tcp flags ALL NONE -j DROP
/ sbin / iptables -A PORTSCAN -p tcp --tcp-flags ALL FIN, PSH, URG -j DROP
/ sbin / iptables -A PORTSCAN -p tcp --tcp-flags ALL SYN, FIN, PSH, URG -j DROP
/ sbin / iptables -A PORTSCAN -p tcp --tcp flags ALL SYN, RST, ACK, FIN, URG -j DROP



echo "--- Perform final configurations ---"
Echo "---------------------------------------"
/ sbin / iptables -N TOGETHER
/ sbin / iptables -A COMMON -j STATE_TRACK
/ sbin / iptables -A COMMON -j PORTSCAN
/ sbin / iptables -A COMMON -j PACKAGE

/ sbin / iptables -A ENTER -j TOGETHER
/ sbin / iptables -A OUTPUT -j TOGETHER
/ sbin / iptables -A FORWARD -j TOGETHER
/ sbin / iptables -A FORWARD -j PACKET

apache 2.2 – Multiple instances that map hosts to port

I'm trying to set up a development environment that I can step into:

project1.com in a browser and go to a specific directory. project2.com changes to another directory. The challenge is, I use laravel and directories set up with artisans are determined by port.

So I want to map something like this:

// I know this does not work, I'm just trying to show what I'm trying to do

127.0.0.1:8000 project1.com
127.0.0.1:8001 project2.com

Is there a way in combination with virtual hosts?





DocumentRoot "/ project1 /"
DirectoryIndex index.php
Server name project1
ServerAlias ​​www.laravel.test
    
    Options All
AllowOverride All
Order Allow, Deny
Allow of all



    



DocumentRoot "/ project2 /"
DirectoryIndex index.php
Server name project2
ServerAlias ​​www.laravel.test
    
    Options All
AllowOverride All
Order Allow, Deny
Allowing all


Hosting Control Panel with Apache Jail / Chroot?

Hello,

I'm looking for a hosting control panel built-in Apache Chroot feature per user.

I've seen that Plesk has this feature, but I do not want to use Oakly / Cpanel panels.

Is there another panel with built-in Apache chroot function?

Mods: Seems like I posted it in the wrong area. If so, please move it to the area of ​​the Hosting Control Panel.

Many Thanks.

What are the most common and basic redirects of Apache htaccess?

Mod_alias and mod_rewrite

There are 2 modules that you can use in htaccess to control redirects. These are called mod_alias and mod_rewrite. To see the difference between the two commands listed below, you need to be familiar with some commands when using mod_alias or mod_rewrite.

mod_alias commands

mod_rewrite commands

mod_alias is considered a simpler forwarding method, while mod_rewrite is considered more advanced and allows more directives. Note that mod_rewrite commands are executed before mod_alias.


Forwarding codes

  • 301 permanent
  • 302 Temporary

How do I redirect an old URL to a new URL?

There are many ways to redirect one page to another with htaccess. 301 is generally the most important and commonly used method because pages require persistent redirects rather than temporary redirects. Persistent redirects are great for keeping placements on one side on top of another.

301 permanent ones

Forwarding 301: Redirect 301 /old.html http://www.example.com/new-url/

RedirectPermanent: RedirectPerm /old.html http://www.example.com/new-url/

RedirectMatch: RedirectMatch 301 ^ old.html $ http://www.example.com/new-url/

RewriteRule:

Rewrite Engine On
RewriteBase /
RewriteRule ^ old.html $ http://www.example.com/new-url/ [R=301,NC,L]

302 Temporary

Forwarding 302: Forwarding 302 /old.html http://www.example.com/new-url/

RedirectTemp: RedirectTemp /old.html http://www.example.com/new-url/

RedirectMatch: RedirectMatch 302 ^ old.html $ http://www.example.com/new-url/

RewriteRule:

Rewrite Engine On
RewriteBase /
RewriteRule ^ old.html $ http://www.example.com/new-url/ [R,NC,L]

Intercept all and redirect non-www to www

You should use mod_write to redirect all requests for non-WWW versions of your site because the $ 1 variable intercepts the page names example.com/page1/ automatically redirects to www.example.com/page1/,

mod_rewrite:

Rewrite Engine On
RewriteCond% {HTTP_HOST}! ^ Www .
RewriteRule ^ (. *) $ Http: //www.% {HTTP_HOST} / $ 1 [R=301,L]

mod_alias:


    
    
    
    Redirect Permanent / http://www.example.com/


Intercept everything and redirect www to no-www

mod_rewrite:

Rewrite Engine On
RewriteCond% {HTTP_HOST} ^ www.example.com $ [NC]
RewriteRule ^ (. *) $ Http: //example.com$1 [R=301,L]

mod_alias:


    
    
    
    Redirect Permanent / http://example.com/


Catch all and redirect from www to no-www (HTTPS)

Rewrite Engine On
RewriteCond% {HTTP_HOST} ^ www.example.com $ [NC]
RewriteRule ^ (. *) $ Https: //example.com$1 [R=301,L]

Force TLS on specific pages and disable them at rest

This script removes TLS on all other pages, apart from the login page and the registration page, which you can easily add | as a separator between file names.

mod_rewrite:

RewriteCond% {HTTPS}
RewriteCond% {SCRIPT_FILENAME}!  / (Login | register) . php [NC]
RewriteRule ^ (. *) $ Http: //% {HTTP_HOST} / $ 1 [R=301,L]

Force TLS across the site

If you want to enforce TLS on the entire site, you can use mod_rewrite to detect that HTTPS is disabled.

mod_rewrite:

Rewrite Engine On
RewriteCond% {HTTPS} off
RewriteRule (. *) Https: //% {HTTP_HOST}% {REQUEST_URI} 

Remove extensions with mod_rewrite from the URL

Some web hosts may need it Options -MultiViews If you want to remove these extensions, test them without. If that does not work, just add it.

Remove extension type PHP:

Rewrite Engine On
RewriteCond% {REQUEST_FILENAME}! -F
RewriteRule ^ ([^.]+) $ $ 1.php [NC,L]

Remove extension type HTML:

Rewrite Engine On
RewriteCond% {REQUEST_FILENAME}! -F
RewriteRule ^ ([^.]+) $ $ 1.html [NC,L]

Remove extension type HTM:

Rewrite Engine On
RewriteCond% {REQUEST_FILENAME}! -F
RewriteRule ^ ([^.]+) $ $ 1.htm [NC,L]

It does not work? Try this (change PHP to the file extension you want to remove):

Options -MultiViews
Rewrite Engine On
RewriteCond% {REQUEST_FILENAME}! -D
RewriteCond% {REQUEST_FILENAME}! -F
RewriteRule ^ ([^.]+) $ $ 1.php [NC,L]

Remove and force slashes

Enforcement:

This redirects all requests without trailing / to the URL with the slash at the end. (In the second part of the bracket, note that these file extensions must be ignored … Because it makes no sense to enforce them / on an image URL.

RewriteCond% {REQUEST_URI}! . (Php | html? | Jpg | gif) $
RewriteRule ^ (. *) ([^/]) $ http: //% {HTTP_HOST} / $ 1 $ 2 / [L,R=301]

Remove:

Rewrite Engine On
RewriteCond% {REQUEST_FILENAME}! -F
RewriteCond% {REQUEST_URI} (. *) $
RewriteRule ^ (. +) / $ Http://www.example.com/$1[R = 301, L

Convert backslashes to forward slashes

This converts all backslashes found in a URL into forward slashes. Good for preventing duplicate content:

Rewrite Engine On
RewriteCond% {REQUEST_URI} (. *) \ (. *)
RewriteRule. *% 1 /% 2 [R=301]

Redirect old domain to new domain

Rewrite Engine On

# Redirect entire site to new domain
RewriteCond% {HTTP_HOST} ^ example.com $ [OR]
RewriteCond% {HTTP_HOST} ^ sub-domain.example.com $ [NC]
RewriteRule ^ (. *) $ Http://new-example.com/$1 [R=301,L]

Redirect to new domain & remove subfolder

Rewrite Engine On

# Rename the folder to match the subfolder you want to remove
RewriteCond% {HTTP_HOST} ^ (www .)? Example-old  .com $ [NC]
RewriteRule ^ folder (/.*)?$ http: //www.example-new.com$1 [L,R=301]

wordpress – Apache on Ubuntu – problem with "virtual folders"

I'm probably wrong to call it a virtual folder, but I have no other way to describe it.

I am an Apache newbie, please excuse me if my question seems quite simple.

In WordPress, you can choose how you want to do URL formatting. One of these options is to enter the date and postal name. For example, "domain.com/2019/07/13/postname".

However, when configuring this setting, Apache issues a document error stating that the / 2019 / … folder was not found on the server. Although I understand the reasons for this issue (because 2019 obviously is not a folder that resides in the / var / www / html folder where my web files reside), I can not say exactly what I mean Apache configuration file or in the virtual host configuration file.

Is there a chance that a webmaster who is far more experienced than me can help me? I appreciate it!

apache2 – How to disable the Apache proxy HTML fix

I'm using the Apache proxy to access a web application on a VM.

The proxy configuration works great, no problems.

One side effect I see, however, is that the Apache proxy "fixes" HTML, which acts as a proxy.

This is not a problem for my own material, but it does horribly render a third-party frame work I use, PatternFly.

A simple example of a typical change in HTML is:

199.200c182.183
<             HWSUPP
<             Chris Welch
---
>             HWSUPP



>             Chris Welch

The < HTML is the proxy source that > is the original.

As you can see, the unnecessary quotes around the row area and the completion tag are removed from the Apache proxy.

Most of the time these fixes are helpful, but they cause render issues when I use PatternFly, which makes the site unusable.

I know the immediate answer is "fix the bad source", but this is impractical because thousands of third-party source text lines and django templates also create their own source.

Is there any way to disable this behavior with the Apache proxy?

The proxy configuration I use is (Apache 2.2.15):

ProxyRequests off

ProxyHTMLLogVerbose On
LogLevel debug

ProxyPass / testcrm / http: // django /
ProxyHTMLURLMap http: // django / testcrm


        ProxyPassReverse /
SetOutputFilter Proxy HTML
ProxyHTMLURLMap // testcrm /
RequestHeader disables accept-encoding

I have tried Apache 2.4 testing and get the same results.

I have encountered this issue, but the question about disabling the feature has not been answered:
mod_proxy (_html) and a bad webserver (returns text / html for JSON data)

Java – Apache Spark job quits in the middle with FileNotFound error

We run a standalone Apache Spark job that retrieves the data from MongoDB and HBase to generate the data segments. Our Spark job ends in the middle due to the following error:

java.io.FileNotFoundException: / var / log / listandclicker / blockmgr-e84681e4-9650-4042-803a-2c27b7d13cb1 / 0d / temp_shuffle_b06108fd-c766-445e-8f8c-e4dab5ccb5 directory
at java.io.FileOutputStream.open0 (native method) ~[na:1.8.0_171]
at java.io.FileOutputStream.open (FileOutputStream.java:270) ~[na:1.8.0_171]
at java.io.FileOutputStream.(FileOutputStream.java:213) ~[na:1.8.0_171]
at org.apache.spark.storage.DiskBlockObjectWriter $$ anonfun $ revertPartialWritesAndClose $ 2.apply $ mcV $ sp (DiskBlockObjectWriter.scala: 215) ~[spark-core_2.11-2.2.0.jar!/:2.2.0]
at org.apache.spark.util.Utils $ .tryWithSafeFinally (Utils.scala: 1346) [spark-core_2.11-2.2.0.jar!/:2.2.0]
at org.apache.spark.storage.DiskBlockObjectWriter.revertPartialWritesAndClose (DiskBlockObjectWriter.scala: 212) [spark-core_2.11-2.2.0.jar!/:2.2.0]
at org.apache.spark.shuffle.sort.BypassMergeSortShuffleWriter.stop (BypassMergeSortShuffleWriter.java:237) [spark-core_2.11-2.2.0.jar!/:2.2.0]
at org.apache.spark.scheduler.ShuffleMapTask.runTask (ShuffleMapTask.scala: 102) [spark-core_2.11-2.2.0.jar!/:2.2.0]
at org.apache.spark.scheduler.ShuffleMapTask.runTask (ShuffleMapTask.scala: 53) [spark-core_2.11-2.2.0.jar!/:2.2.0]
at org.apache.spark.scheduler.Task.run (Task.scala: 108) [spark-core_2.11-2.2.0.jar!/:2.2.0]
at org.apache.spark.executor.Executor $ TaskRunner.run (Executor.scala: 335) [spark-core_2.11-2.2.0.jar!/:2.2.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149) [na:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:624) [na:1.8.0_171]
at java.lang.Thread.run (Thread.java:748) [na:1.8.0_171]

Any insights or suggestions are deeply appreciated! Many thanks!

java – problem with Apache Tomcat and Eclipse

It was intended to achieve a solar eclipse with the Apache hangover, and there was a problem with the Web Pero Teniendo … A solar eclipse was created with the Apache host: 8080 y al / manager, pero cuando entro a localhost: 8080 / aplicacion me da error 404.

The application is usually not in the hand, but only in the local and not in the hayloft.

It continues with the Tengo.

JDK 1.8
Apache Tomcat 9

Creo el server tomcat 9 y le añado la aplicacion web, supongamos que el proyecto se llama "aplicacion".

Introduction to the image description

Ahora, modifico read propiedades del servidor:
* Elijo la opcion de "use tomcat installation" for me as a friend of the cat (ahora mismo está en mi escritorio)
* Desde la configuration del tomcat, me voy a la pestaña "Modules" and cambiamos el web-modules de "aplicacion" and "aplicacion-web" (for the creation of a document), esto it debido a el archivo aplicacion.xml , el nombre de la aplicacion es ", por eso en web-modules hay que poner el mismo nombre.

Introduction to the image description

Introduction to the image description

Bien, ahora, compilo todo mediante el ANT.build, me compila correctamente y me genera el. WAR en la ruta at work, tal que así / workspace / {name_project} / target, aquí está generado el. WAR

Vale, ahora inicio la aplicacion de el botón verde (play) de tomcat / eclipse para arrancar la appi … y aqui es donde tengo problemas.

I solo 5 segundos y no me cuadra, it como si no pillara el. War … a local host: 8080 y a localhost: 8080 / manager. The manager is responsible for the app "desplegada" and has the following address: 8080 / aplicacion-web / es cuando me da el error 404

July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Name of the server version: Apache Tomcat / 9.0.21
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 4 2019 20:19:36 UTC
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version number: 9.0.21.0
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Name of the operating system: Windows 7
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: OS version: 6.1
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Java start page: C:  opt  Java  jdk1.8.0_40  jre
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM version: 1.8.0_40-b26
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Provider: Oracle Corporation
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:  Users  usuario  Desktop  apache-tomcat-9.0.21
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:  Users  usuario  Desktop  apache-tomcat-9.0.21
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command-line argument: -Dcatalina.base = C:  Users  usuario  Desktop  apache-tomcat-9.0.21
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command-line argument: -Dcatalina.home = C:  Users  usuario  Desktop  apache-tomcat-9.0.21
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command-line argument: -Dwtp.deploy = C:  Users  usuario  Desktop  apache-tomcat-9.0.21  wtpwebapps
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command-line argument: -Djava.endorsed.dirs = C:  Users  usuario  Desktop  apache-tomcat-9.0.21  indorsed
July 10, 2019 9:48:36 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command-line argument: -Dfile.encoding = Cp1252
July 10, 2019 9:48:36 pm org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Loaded APR-based Apache Tomcat native library [1.2.21] with APR version [1.6.5],
July 10, 2019 9:48:36 pm org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR functions: IPv6 [true], Send file [true]Accept filter [false], by chance [true],
July 10, 2019 9:48:36 pm org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR / OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
July 10, 2019 9:48:36 org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL has been successfully initialized [OpenSSL 1.1.1a  20 Nov 2018]
July 10, 2019 9:48:37 org.apache.coyote.AbstractProtocol init
INFO: Initialization of ProtocolHandler ["http-nio-8080"]
July 10, 2019 9:48:37 org.apache.coyote.AbstractProtocol init
INFO: Initialization of ProtocolHandler ["ajp-nio-8009"]
July 10, 2019 9:48:37 org.apache.catalina.startup.Catalina load
INFO: Server initialization in [1,283] milliseconds
July 10, 2019 9:48:37 org.apache.catalina.core.StandardService startInternal
INFO: Starting the service [Catalina]
July 10, 2019 9:48:37 org.apache.catalina.core.StandardMotorstartInternal
INFO: Start servlet engine: [Apache Tomcat/9.0.21]
July 10, 2019 9:48:38 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS property maxActive is not used in DBCP2, use maxTotal instead. The default value for maxTotal is 8. You have set the value "20" for the maxActive property, which is ignored.
July 10, 2019 9:48:38 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS maxWait property is not used in DBCP2. Use maxWaitMillis instead. The default value of maxWaitMillis is -1. You set the value "10000" for the maxWait property, which is ignored.
July 10, 2019 9:48:38 org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was searched for TLDs that did not contain TLDs. Enable debug logging for this logger for a complete list of scanned JARs, but no TLDs were found. Skipping unneeded JAR files during scanning can improve startup time and JSP compile time.
July 10, 2019 9:48:39 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
WARNING: Create a SecureRandom instance to generate the session ID with [SHA1PRNG] took [128] Milliseconds.
July 10, 2019, 09:48:39 pm org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying the Web Application Directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappsdocs]
July 10, 2019 9:48:39 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS property maxActive is not used in DBCP2, use maxTotal instead. The default value for maxTotal is 8. You have set the value "20" for the maxActive property, which is ignored.
July 10, 2019 9:48:39 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS maxWait property is not used in DBCP2. Use maxWaitMillis instead. The default value of maxWaitMillis is -1. You set the value "10000" for the maxWait property, which is ignored.
July 10, 2019 9:48:39 org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was searched for TLDs that did not contain TLDs. Enable debug logging for this logger for a complete list of scanned JARs, but no TLDs were found. Skipping unneeded JAR files during scanning can improve startup time and JSP compile time.
July 10, 2019, 09:48:39 pm org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of the web application directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappsdocs] is ready in [611] Mrs
July 10, 2019, 09:48:39 pm org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying the Web Application Directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappsexamples]
July 10, 2019 9:48:40 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS property maxActive is not used in DBCP2, use maxTotal instead. The default value for maxTotal is 8. You have set the value "20" for the maxActive property, which is ignored.
July 10, 2019 9:48:40 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS maxWait property is not used in DBCP2. Use maxWaitMillis instead. The default value of maxWaitMillis is -1. You set the value "10000" for the maxWait property, which is ignored.
July 10, 2019 9:48:40 org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was searched for TLDs that did not contain TLDs. Enable debug logging for this logger for a complete list of scanned JARs, but no TLDs were found. Skipping unneeded JAR files during scanning can improve startup time and JSP compile time.
July 10, 2019 9:48:40 org.apache.catalina.core.ApplicationContext protocol
INFO: ContextListener: contextInitialized ()
July 10, 2019 9:48:40 org.apache.catalina.core.ApplicationContext protocol
INFO: SessionListener: contextInitialized ()
July 10, 2019 9:48:40 org.apache.catalina.core.ApplicationContext protocol
INFO: ContextListener: attributeAdded (& # 39; StockTicker & # 39; async.Stockticker@492521c4&#39;)
July 10, 2019, 09:48:40 pm org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of the web application directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappsexamples] is ready in [1,111] Mrs
July 10, 2019, 09:48:40 pm org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying the Web Application Directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappshost-manager]
July 10, 2019 9:48:41 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS property maxActive is not used in DBCP2, use maxTotal instead. The default value for maxTotal is 8. You have set the value "20" for the maxActive property, which is ignored.
July 10, 2019 9:48:41 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS maxWait property is not used in DBCP2. Use maxWaitMillis instead. The default value of maxWaitMillis is -1. You set the value "10000" for the maxWait property, which is ignored.
July 10, 2019 9:48:41 org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was searched for TLDs that did not contain TLDs. Enable debug logging for this logger for a complete list of scanned JARs, but no TLDs were found. Skipping unneeded JAR files during scanning can improve startup time and JSP compile time.
July 10, 2019, 09:48:41 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of the web application directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappshost-manager] is ready in [609] Mrs
July 10, 2019, 09:48:41 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying the Web Application Directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappsmanager]
July 10, 2019 9:48:41 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS property maxActive is not used in DBCP2, use maxTotal instead. The default value for maxTotal is 8. You have set the value "20" for the maxActive property, which is ignored.
July 10, 2019 9:48:41 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS maxWait property is not used in DBCP2. Use maxWaitMillis instead. The default value of maxWaitMillis is -1. You set the value "10000" for the maxWait property, which is ignored.
July 10, 2019 9:48:41 org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was searched for TLDs that did not contain TLDs. Enable debug logging for this logger for a complete list of scanned JARs, but no TLDs were found. Skipping unneeded JAR files during scanning can improve startup time and JSP compile time.
July 10, 2019, 09:48:41 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of the web application directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappsmanager] is ready in [583] Mrs
July 10, 2019, 09:48:41 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying the Web Application Directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappsROOT]
July 10, 2019 9:48:42 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS property maxActive is not used in DBCP2, use maxTotal instead. The default value for maxTotal is 8. You have set the value "20" for the maxActive property, which is ignored.
July 10, 2019 9:48:42 org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory getObjectInstance
WARNING: name = aplicacion3DS maxWait property is not used in DBCP2. Use maxWaitMillis instead. The default value of maxWaitMillis is -1. You set the value "10000" for the maxWait property, which is ignored.
July 10, 2019 9:48:42 org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was searched for TLDs that did not contain TLDs. Enable debug logging for this logger for a complete list of scanned JARs, but no TLDs were found. Skipping unneeded JAR files during scanning can improve startup time and JSP compile time.
July 10, 2019, 09:48:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of the web application directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappsROOT] is ready in [556] Mrs
July 10, 2019 9:48:42 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
July 10, 2019 9:48:42 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
July 10, 2019 9:48:42 org.apache.catalina.startup.Catalina start
INFO: Server start in [5,222] milliseconds

Introduction to the image description

Introduction to the image description

It como si el tomcat no me cogiera el. WAR … Server configuration:

Introduction to the image description

See also "-Dwtp.deploy" and "wtpwebapps" for tomcat and digo tests and answers to your questions el .war descomprimido) y me sigue sin ir.

Other curiosities related to the carp of the Apache cat, the webapp ../apache-tomcat-9.0.21webapps, the war against time (imaginemos aplicacion-web_2) and the eclipse "INFO: Providing the web application directory [C:UsersusuarioDesktopapache-tomcat-9.0.21webappsaplicacion-web-2]"y aqui si entro al manager del tomcat, si que me aparecen aplicacion-web y aplicacion-web-2, peron ninguna de las 2 entra (error 404 en las 2).

Introduction to the image description

It comes to a solar eclipse, which is not an age of war (ruta times definida), and it comes to a web application that accompanies the war.

The display of the .war Descomprimido and the Webapps for the Carpeta del Tomcat and the 100-Segundos version of the server and the Eclipse, as a bug in the BBDD has occurred and the BBDD version of the Tenemos and the .context not the function has and the BBDD number The function is not activated, no error has occurred. 404 No?

¿Alguna idea ?, no tiene sentido estar generando el .war y descomprimiendolo a mano en la carpeta del tomcat, ¿no? deberia cogerlo solo el servidor

Gracias !!