How to unlock Glassfish server.log.lck? - glassfish

I have a small problem in my Glassfish logs directory. Logs directory is located in glassfish/domains/domain1/. The problem is that the Glassfish won't update server.log file whenever I do some change to my web application which uses Glassfish as a server. This used to work.
In logs directory there's also a file called server.log.lck, which means that it locks the server.log file and thus it won't update it. My question is that how I can unlock server.log file so that server.log file is being updated whenever I get an error?

It should be sufficient to delete the file server.log.lck to get Glassfish writing to the server.log again. If you can't delete the file because it "is in use", you have to stop Glassfish and delete the file.
PS: If you are on Windows and the problem occurs again, it may be a problem with the access rights for the Glassfish domain folder.

FWIW, this issue was hit on Payara server v5.184 (based on Glassfish) running on an AWS EC2 instance. After the instance was rebooted, Payara would not start up.
The problem was the root file-system went into a read-only (ro) mode:
$ mount -l
/dev/xvda1 on / type xfs (ro,relatime,attr2,inode64,noquota) [/]
Was fixed by running
mount / -o remount,rw

Related

Where can I find httpd.conf file for Apache on my windows?

I am trying to fix one venerability on my production web server(Apache), Venerability is "The HTTP headers sent by the remote web server disclose information that can aid an attacker, such as the server version and technologies used by the web server"
For this I have gone for some solutions , some where I found that to solve the above Venerability we need to edit the httpd.conf file on server but I did not find httpd.conf file in my entire system (using windows 10 os) can any one please let me know hot find that file or how to resolve that Venerability on production ?
You can find httpd.conf in
installed folder ex Apache24
Apache24/conf/httpd.conf
On Windows, I have seen people run Apache from all kinds of weird and wonderful places.
You need to track down where your Apache instance is running from, normally its running as a service on windows. If you open the properties on the service and look at the Path to executable, it should be something similar to the below.
"C:\Program Files\Apache24\bin\httpd.exe" -k runservice
Or it could be
"D:\Some Application\Version\WEB\tool\SOFTS\HTTPD\bin\httpd.exe" -k runservice
Unless there is an -f flag, setting the location of the conf. There will be a "conf" folder at the same level as the "bin" folder regardless of the path. This location is set at compile time so unless you have bespoke version off Apache this should be the location.
If you are struggling to find the service or a launcher that is running Apache. You can use WMI with a WQL query to look for processes which are called httpd.exe and get its executable path.
wmic process WHERE name="httpd.exe" GET ExecutablePath
In Xampp Control panel, in apache row, click on "config" button and then you see the term Apache(httpd.conf).

Docker for Win acme.json permissions

Traefik v1.3.1
Docker CE for Windows: 17.06.0-ce-win18 (12627)
I have the /acme folder routed to a host volume which contains the file acme.json. With the Traefik 1.3.1 update, I noticed that Traefik gets stuck in an infinite loop complaining that the "permissions 755 for /etc/traefik/acme/acme.json are too open, please use 600". The only solution I've found is to remove acme.json and let Traefik re-negotiate the certs. Unfortunately, if I need to restart the container, I have to remove acme.json again or I'm stuck with the same issue again!
My guess is that the issue lies with the Windows volume mapped to Docker but I was wondering what the recommended workaround would even be for this?
Can I change permissions on shared volumes for container-specific deployment requirements?
No, at this point, Docker for Windows does not enable you to control (chmod) the Unix-style permissions on shared volumes for deployed containers, but rather sets permissions to a default value of 0755 (read, write, execute permissions for user, read and execute for group) which is not configurable.
Traefik is not compatible with regular Windows due to the POSIX permissions check. It may work in the Windows Subsystem for Linux since that has a Unix-style permission system.
Stumbled across this issue when trying to get traefik running on Docker for Windows... ended up getting it working by adding a few lines to a dockerfile to create the acme.json and set permissions. I then built the image and despite throwing the "Docker image from Windows against a non-Windows Docker host security warning" when I checked permissions on the acme.json file it worked!
[
I setup a repo and have it auto building to the dockerhub here for further testing.
https://hub.docker.com/r/guerillamos/traefik/
https://github.com/guerillamos/traefikwin/blob/master/Dockerfile
Once I got that built I switched the image out in my docker-compose file and my DNS challenge to Cloudflare worked like a charm according to the logs.
I hope this helps someone!

Why won't OpenERP7/Odoo restore a database when running via Docker behind an NGINX reverse proxy?

Setup:
1.OpenERP/Odoo installed in a Docker environment as a single file. In other words, OpenERP/Odoo and a PostgreSQL database are installed by running a single "run" command.
NGINX used as a reverse proxy
Restore database over 1Mb in size.
Reference:
Error message in restoring database via both zip file and dump file for Odoo 8
Symptoms:
OpenERP/Odoo starts to upload database but then states that database cannot be restored while at the same time advising that the database has been restored.
Database is not available at the central OpenERP/Odoo log-in screen.
For newbies like myself the experience of this problem was particularly frustrating. The problem stems from a default setting within NGINX that limits NGINX interaction with a client (the computer used to restore the database to OpenERP/Odoo) to a 1Mb upload. As a result, the database restoration feature of OpenERP/Odoo appears broken. Thankfully, the reference in the question above hinted at the problem and the solution. Included below is a more richly documented instruction set on correcting the NGINX configuration that prevents Openerp/Odoo database restoration.
Attach to Docker container
$ docker exec -it [containerIdOrName] bash
If this is the first time trying to modify NGINX install VI
$ apt-get update
$ apt-get install vim
Set client_max_body_size to 0 to disable body size checking
See Module ngx_http_core_module for more information on settings
$ vi /etc/nginx/nginx.conf
http{ ...
client_max_body_size 0;
}
Exit out of NGINX container
$ exit
Restart NGINX container
$ docker restart [containerIdOrName]
Give database restoration a try.
Please post corrections or additions to this method to sweeten the process up for others that are struggling bushwhacking their way through virtualization.

WAMP Server 3.0.0 cannot open apache conf file

I've re-installed WAMP in order to put it into a different directory. This was mainly so everything is automatically backed up.
Mysql starts ok, but apache fails with the following message from the event viewer:
The Apache service named reported the following error:
httpd.exe: Could not open configuration file bin/conf/httpd.conf: The system cannot find the path specified. .
This file is in the correct place (C:\googledrive\wamp64\bin\apache\apache2.4.17\conf) and there isn't any other stray httpd.conf files that it might be picking up on the path or anywhere.
Any ideas?
This turned out to be a permissions problem. It seems that the system account didn't have access to the directory containing the config file, but I guess must have had enough access to start up Apache and give that helpful (not) message!

Is it possible to have WAMP run httpd.exe as user [myself] instead of local SYSTEM?

I run a django application over apache with mod_wsgi, using WAMP.
A certain URL allows me to stream the content of image files, the paths of which are stored in database.
The files can be located whether on local machine or under network drive (\\my\network\folder).
With the development server (manage.py runserver), I have no trouble at all reading and streaming the files.
With WAMP, and with network drive files, I get a IOError : obviously because the httpd instance does not have read permission on said drive.
In the task manager, I see that httpd.exe is run by SYSTEM. I would like to tell WAMP to run the server as [myself] as I have read and write permissions on the shared folder. (eventually, the production server should be run by a 'www-admin' user having the permissions)
Mapping the network shared folder on a drive letter (Z: for instance) does not solve this at all.
The User/Group directives in httpd.conf do not seem to have any kind of influence on Apache's behaviour.
I've also regedited : I tried to duplicate the HKLM\[...]\wampapache registry key under HK_CURRENT_USER\ and rename the original key, but then the new key does not seem to be found when I cmd this
> httpd.exe -n wampapache -k start
or when I run WAMP.
I've run out of ideas :)
Has anybody ever had the same issue?
Win+R, services.msc
edit wampapache and wampmysqld to log on as some user.
the tray icon is a convenient front end to "net start wampapache" and "net start wampmysqld"
The User/Group directives in httpd.conf do not seem to have any kind of influence on Apache's behaviour.
httpd.exe is started by the root user (this is probably why you see it running under SYSTEM). The user and group lines in httpd.conf determine what user the child processes (that httpd spawns) will run under. These forks are what actually handle page requests, etc. so it is possible that your configuration is already doing what you want it to, it is just unclear from looking at task manager.
You could also try using runas to start WAMP/Apache, though your mileage may vary.
I've just found that executing httpd.exe myself works for me... I just loose all the funky WAMP tray icon, and the "restart apache" menu item, really handy whenever I update my application code...
I'll have to make do with this for the moment...