Changing the wildfly.service to newname_wildfly.service - centos

WildFly noob here. I would like to change the name of the service as said in the title. My question is if I change the name of the file wildfly.service, will the whole thing break? What method should I follow to change the name of the service?
wildfly.service file
[Unit]
Description=WildFly application server
After=syslog.target network.target
Before=http.service
[Service]
Enviornment=LAUNCH_JBOSS_IN_BACKGROUND=1
EnviornmentFile=-/etc/wildfly/wildfly.conf
User=wildfly
LimitNOFILE?102642
ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND $WILDFLY_CONSOLE_BIND
StandardOutput=null
[Install]
WantedBy=multi-user.target
Thank you!
EDIT: It did crash after I changed the file name wildfly.ervice. How do I add a new service with a different name?

SOLUTION: What I tried first was, renaming the wildfly.service to newname.service,
mv wildfly.service newname_wildfly.service
knowing it will probably break the whole thing. And it did. After that, I changed it back to wildfly.service and it didn't work. Nor the reload service and starting it up again worked.
So I started the project once again and before creating the symlink, I renamed the /etc/systemd/system/multi-user.target.wants/nginx.service to newname.service and then created the symlink. I know this maybe isn't the best solution for this but after a lot of research, this was more or less the best option for me.
Hope this helps anyone who ran into the same problem as I did. Cheers!

Related

Debian: where are services installed

I want edit raspberrypi-net-mods.service to copy a file, rather than move it.
How would I go about locating this please?
YOu can get the location of a systemd-unit via
systemctl status raspberrypi-net-mods.service
You shouldn't edit system-installed service-files directly.
Instead you can customize a service by adding configuration to /etc/systemd/system/
You probably want to read the documentation, e.g. man 5 systemd.unit

How to give www.domain.tld its own seperate folder?

I would like to try something.
I wanted to have on http://domain.tld/ a Multiuser Wordpress Install and on http://www.domain.tld/ a Link Directory.
As of now, the easiest way to go seemed like seperating www from non-www while putting the www in its own folder and haveing somewhere in the non-www version a clean redirect that in case someone opens the plain http://domain.tld, s/he would het redirected to http://www.domain.tld/ .. while users who open http:domain.tld/wp-admin would end up in the wordpress Login/Dashboard
Is there any idea you could give me how to seperate those two url's?
SOLUTION for WHM/cPanel Server
As I am not fond with console commands/navigation, I have used for everything WinSCP.
You might want to create a Testsubdomain if there is none.
locate this folder /var/cpanel/userdata/username where "username" is the username for the Account.
You will find several files like
domain.tld.cache
domain.tld
cache
main
main.cache
testsubdomain.domain.tld.cache
testsubdomain.domain.tld
Nearly all of them need to be edited. Download them all and edit them in an editor like Notepad++ .. rename testsubdomain files to www.domain.tld and www.domain.tld.cache .. Edit www.domain.tld like this
---
documentroot: /home/USERNAME/public_html/www
group: USERNAME
hascgi: 1
homedir: /home/USERNAME
ip: XX.XX.XX.XX
ipv6: ~
no_cache_update: 0
owner: root
phpopenbasedirprotect: 1
serveradmin: webmaster#www.domain.tld
serveralias: www.domain.tld
servername: www.domain.tld
usecanonicalname: 'Off'
user: USERNAME
userdirprotect: ''
do the same in www.domain.tld.cache.
Edit all other files and check that you change everywhere the testsubdomain to www .....
Upload everything and well, I simply had to wait just a wee bit (30 minutes where I was still looking for a solution) and it worked perfectly!
I could use the Wordpress Plugin "Eggplant 301 Redirects" to create with the Plugin an 301 Redirect from http://domain.tld to http://www.domain.tld/ that works like a charm.
Problem perfectly solved in my opinion a perfect manner :) ... all by myself :P ... I just have to update the places where I had asked for some intel/help in the Problem solving..... Strange that I didn't got some, but maybe its just too odd :)
Well, I have updated my initial Question, so that it no longer really is a question, but an answer too.
Took me quite some time, lots and lots of searching, finding breadcrumps and in the end it could have been solved already at least 4 hours ago sigh (In my first trys I had messed around in the DNS Entries, removed the default created entry for www and changed it from a CNAME record to an A record and that seemed to have caused the problem that my changes were not properly executed and only after I had terminated the account and recreated, uploaded the already long time edited files via SCP again, it worked) ... but in the end it is done
Thank you all for reading and I truly hope that this might help also someone else.

Play change RUNNING_PID file path

I am trying to store the RUNNING_PID file at /var/run instead of root directory.
Tried all the options suggested at:
Another SO question about the subject
and the solution play suggest in their documnetation: Play additional configuration
Yet when I start my app the RUNNING_PID file is created in root directory and the /var/run/play.pid remains empty
Put
play.server.pidfile.path=/var/run/RUNNING_PID
in your application.conf
Create a "play" user and group in Linux, so it runs in a secure fashion.
In the SystemD service file, and within [Service] area use:
[Service]
# Create the Directory /var/run/play (which Play will have write permissions to)
RuntimeDirectory=play
RuntimeDirectoryMode=0710
User=play
Group=play
In the ExecStart, specifically pass the system property "pidfile.path":
ExecStart=/opt/play-1.0.0/bin/play -Dconfig.file=/path/to/my/application.conf \
-Dpidfile.path=/var/run/play/play.pid
Below worked for me in Play 2.8 (🍾🍾):
Add this property to you application.conf present in conf directory:
play.server.pidfile.path=/var/run/RUNNING_PID
Note: It will try to create a file under /var/run and if you don't want/have the right to write to the filesystem i.e you are running your application in Kubernetes (1.20) pod change it to /dev/null.
play.server.pidfile.path=/dev/null
Hope this helps, Cheers (🍾🍾).

Typo3 Extbase plugin Schelduler

Is there any tutorial or example how to call extbase action from Schelduler?
I found something about CommandControler, but it did not work.
Hope this helps (although in German)
http://www.derhansen.de/2012/06/seit-extbase-4.html
.Make sure that in your LocalConfiguration.php are right credentials to DB.
It is important if you want to run script with CLI. Like: sudo php ./typo3/cli_dispatch.phpsh scheduler
Otherways even if you put "echo" or "var_dump" in YourCommandController it will be not ouputed. The script stops by trying to get user info from DB.

Why does my Apache2::Log output replace newlines with \n?

I've set up multiple vhosts under apache2 / mod_perl. I used the ErrorLog directive to get a separate error log for each vhost. This only worked as expected when I used Apache2::Log. 'warn' would only log to the regular error log.
So that's all working. Finally. But there's one issue remaining: When I log via $r->log_error, I find that newlines are replaced with \n
Any idea why this happens, and how it can be fixed?
Thanks.
This is not a mod_perl problem, but an Apache one. Apparently there are some security concerns with printing unescaped output to the error logs (I'm not entirely sure why) so you have to explicitly enable this in Apache when building/configuring it using this:
CFLAGS=-DAP_UNSAFE_ERROR_LOG_UNESCAPED ./configure
If you're using an already installed apache, there's not much you can do to change this.
If you have a pre-built install, you can use this line of code to fix the issue but it must be included in every page execution within your vhost, say in a header.php or config.php file.
ini_set('error_log','/var/log/apache2/error.log');
i know this is very old thread, but still coming on top on google results, so just to help all, the following changes in mod_perl.pl did helped me:
comment out below:
BEGIN { *CORE::GLOBAL::warn = \&Apache2::ServerRec::warn; }
the above is for:
Make warnings go to the virtual host's log and not the main server log.
i hope this helps anyone out there like me :)