EasyPHP Webserver - Dashboard - http://127.0.0.1:10000 No longer loading - webserver

I am running EasyPHP Webserver 14.1 on Win Server 2012.
When I first installed it the dashboard loaded fine.
Now that I have built up my PHPbb3 forum it no longer loads. The browser continuously states
Waiting for response from 172.0.0.1...
but nothing happens, it just keeps spinning trying to load.
Is there any way I can fix /restore / reinstall the dashboard without affecting any work I've done on PHPbb3?
If it helps after some searching on this forum I created a .bat file containing:
ews-dashboard.exe -S 127.0.0.1:10000 -c ews-dashboard.ini cmd /k
This opens a CMD window containing the following:
C:\Program Files (x86)\EasyPHP-Webserver-14.1b2\dashboard>ews-dashboard.exe -S 127.0.0.1:10000 -c ews-dashboard.ini
PHP 5.4.30 Development Server started at Tue Nov 14 14:33:33 2017
Listening on http://127.0.0.1:10000
Document root is C:\Program Files (x86)\EasyPHP-Webserver-14.1b2\dashboard
Press Ctrl-C to quit.
But this doesn't seem to change anything.

it will work if you change the current port.
start-ews.bat
ews-dashboard.exe -S 127.0.0.1:1000 -c ews-dashboard.ini cmd /k
ews-dashboard.ini
[ServiceEx]
ServiceExeFullPath = "D:/Program Files/EasyPHP-Webserver\dashboard\ews-dashboard.exe"
; program arguments to be sent to executable
options = "-S 127.0.0.1:1000"
; can program interact with desktop [true | false] (default: true)
desktop = false
; start type (valid values: Auto Manual Disabled) (default: auto)
Start=Auto
; start the service upon installation [true | false] (default: no)
StartNow=true

Related

How to minimize Eclipse PyDev Console output / tracing

I have multiple installations of Eclipse(2021-12) + PyDev(9.3.0.202203051235) all using Iron Python(2.7). All running on Windows 10. They all run the scripts as expected, but one installation has a much more robust console output when debugging, almost like a tracing option is enabled. I've tried reinstalling, deleting workspaces, deleting '.metadata' folders, etc. All the project settings seem identical.
Any ideas how to minimize the console output? Something in registry?
Expected Console output:
pydev debugger: starting (pid: 15312)
Actual Console output:
1.99s - Using GEVENT_SUPPORT: False
0.00s - Using GEVENT_SHOW_PAUSED_GREENLETS: False
0.00s - pydevd __file__: C:\\Eclipse-2021-12-R\plugins\org.python.pydev.core_9.3.0.202203051235\pysrc\pydevd.py
0.11s - Initial arguments: (['C:\\Eclipse-2021-12-R\\plugins\\org.python.pydev.core_9.3.0.202203051235\\pysrc\\pydevd.py', '--multiprocess', '--protocol-http', '--print-in-debugger-startup', '--vm_type', 'python', '--client', '127.0.0.1', '--port', '60413', '--file', 'C:\\Test.py'],)
0.00s - Current pid: 8884
pydev debugger: starting (pid: 8884)
Those should only appear if you add an environment variable asking it to be shown.
i.e.: Something as:
PYDEVD_DEBUG=1
PYDEV_DEBUG=1
Maybe you have such an environment set in your launch configuration or interpreter configuration or elsewhere in your system?
You may want to check the os.environ of the running program to see what's set there.

I am trying to create a tpm2-based auto unlock sh script, but the script fails with file not found

I am trying to create a TPM-based unlock script using tpm2-tools with instructions from Tevora Secure boot tpm2. I have set up the key, loaded it with cryptsetup luksAddKey secret.bin, then tested it using tpm2_unlock -c 0x81000000 --auth pci:sha1:0,2,3,7 and returns the value of secret.bin. For extra measures, to make sure it works, I loaded secret.bin into "/etc/crypttab", ran # update-initramfs -u -k all, and rebooted. Upon reboot, the system unlocked.
I copied over the following code into "/etc/initramfs-tools/hooks/tpm2"
#!/bin/sh -e
if [ "$1" = "prereqs" ]; then exit 0; fi
. /usr/share/initramfs-tools/hook-functions
copy_exec /usr/local/bin/tpm2_unseal
copy_exec /usr/local/lib/libtss2-tcti-device.so
I appended my etc/crypttab from cryptname UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx none luks to cryptname UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx none luks,keyscript=/usr/local/bin/passphrase-from-tpm
I rewrote the following script because the tpm2-tools command was outdated, edited in the new command, and stored it in /usr/local/bin/passphrase-from-tpm:
#!/bin/sh
set -e
echo "Unlocking via TPM" >&2
export TPM2TOOLS_TCTI="device:/dev/tpm0"
/usr/local/bin/tpm2_unseal -c 0x81000000 --auth pcr:sha1:0,2,3,7
if [ $? -eq 0 ]; then
exit
fi
/lib/cryptsetup/askpass "Unlocking the disk fallback $CRYPTTAB_SOURCE ($CRYPTTAB_NAME)\nEnter passphrase: "
I ran # update-initramfs -u -k all then rebooted. In reboot, I get the following error: /lib/cryptsetup/scripts/passphrase-from-tpm: line 5: /usr/local/bin/tpm2_unseal: not found
I have tried many times to edit passphrase-from-tpm unsuccessfully, including:
Moving both passphrase-from-tpm into "/boot/efi/EFI/BOOT/" and referencing crypttab to that file
Modifying passphrase-from-tpm to use a relative file path to tpm_unseal
Before I figured out how to create a backup linux boot using:
objcopy \
--add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
--add-section .cmdline=cmdline.txt --change-section-vma .cmdline=0x30000 \
--add-section .linux="/boot/vmlinuz" --change-section-vma .linux=0x40000 \
--add-section .initrd="/boot/initrd.img" --change-section-vma .initrd=0x3000000 \
/usr/lib/systemd/boot/efi/linuxx64.efi.stub /boot/EFI/BOOT/BOOT_RECX64.EFI
I would be locked out of the system completely because of the error and had to reinstall Ubuntu about 40 times. I have suffered a lot and want to quit but I am too stubborn to throw in the flag.
just copy tpm2_unseal to /usr/local/bin/
I'm trying to make a working setup following basically those instructions, plus a few others I have found. While not working 100% yet, check that both /etc/initramfs-tools/hooks/tpm2 and /usr/local/bin/passphrase-from-tpm are marked executable (sudo chmod ug+x $filename).
After making the initramfs, you can run the following to ensure that the TPM related files are actually in the image. Replace the path in the filename by whatever update-initramfs said it was generating:
$ lsinitramfs /boot/initrd.img-5.0.0-37-generic | egrep "(tpm|libtss)"
lib/cryptsetup/scripts/passphrase-from-tpm
lib/modules/5.0.0-37-generic/kernel/crypto/asymmetric_keys/tpm_key_parser.ko
lib/modules/5.0.0-37-generic/kernel/crypto/asymmetric_keys/asym_tpm.ko
lib/udev/rules.d/tpm-udev.rules
usr/local/lib/libtss2-sys.so.0
usr/local/lib/libtss2-mu.so.0
usr/local/lib/libtss2-sys.so.0.0.0
usr/local/lib/libtss2-tcti-device.so
usr/local/lib/libtss2-tcti-device.so.0
usr/local/lib/libtss2-tcti-device.so.0.0.0
usr/local/lib/libtss2-mu.so.0.0.0
usr/local/bin/tpm2_unseal
Additionally, I have modified /usr/local/bin/passphrase-from-tpm to the following:
#!/bin/sh
TPM_DEVICE=/dev/tpm0
TPM_REGISTER=0x81000001
TPM_SEAL_POLICY=sha256:0,2,4,7
export TPM2TOOLS_TCTI="device:$TPM_DEVICE"
if [ "$CRYPTTAB_TRIED" -eq 0 ]; then
echo "Unlocking via TPM" >&2
/usr/local/bin/tpm2_unseal -H $TPM_REGISTER -L $TPM_SEAL_POLICY
UNSEAL_STATUS=$?
echo "Unseal status $UNSEAL_STATUS" >&2
if [ $UNSEAL_STATUS -eq 0 ]; then
exit
fi
else
echo "TPM unlocking previously failed for $CRYPTTAB_SOURCE ($CRYPTTAB_NAME)" >&2
/lib/cryptsetup/askpass "Enter passphrase for $CRYPTTAB_SOURCE ($CRYPTTAB_NAME): "
fi
Note that the command line options to tpm2_unseal are for the 3.x versions of tpm2-tools. If you're using another version, you might need to update the options.
I pulled out various bits into variables at the top of the file. Modify TPM_REGISTER and TPM_SEAL_POLICY to match how you created the TPM object. set -e was removed since if any command failed, the whole script would exit, preventing the askpass fallback from ever running if tpm2_unseal failed.
Additionally, I noticed that if the script fails for some reason, systemd will attempt to run it again. If the secret in the TPM doesn't match the LUKS key, this will render the system unbootable, since the unseal succeeds, but unlocking fails, and systemd will run the script again.
Looking at the man page for crypttab, I discovered that one of the environment variables provided to the keyscript is CRYPTTAB_TRIED which is the number of tries it has attempted to unlock the volume. If CRYPTTAB_TRIED is 0, it'll attempt to use the TPM, as shown by this test (Running as non-root, so accessing the TPM device fails):
$ export CRYPTTAB_SOURCE=some_device
$ export CRYPTTAB_NAME=some_device_name
$ export CRYPTTAB_TRIED=0
$ ./passphrase-from-tpm
Unlocking via TPM
ERROR:tcti:src/tss2-tcti/tcti-device.c:440:Tss2_Tcti_Device_Init() Failed to open device file /dev/tpm0: Permission denied
ERROR: tcti init allocation routine failed for library: "device" options: "/dev/tpm0"
ERROR: Could not load tcti, got: "device"
Unseal status 1
When it tries running the script again, CRYPTTAB_TRIED will be greater than 0, making it display the password prompt instead:
$ export CRYPTTAB_TRIED=1
$ ./passphrase-from-tpm
TPM unlocking previously failed for some_device (some_device_name)
Enter passphrase for some_device (some_device_name):
Hopefully this is still of use to you, and helpful to anyone else trying to get the house of cards that is disk encryption with a TPM on Linux working.

How can I debug odoo 9 in eclipse? [Linux]

I have eclipse Neon in Linux Ubuntu 16.04
When I run a odoo server, it works everything fine in port 8069
But, when I debug the same odoo server, (now, the port is 8072) it appears to freeze in a infinite loop. In the browser doesn't appear anything (Waiting for localhost...), and the log shows this:
...
25138 INFO mydb openerp.modules.loading: 81 modules loaded in 0.73s, 0 queries
25138 INFO mydb openerp.modules.loading: Modules loaded.
25138 INFO mydb openerp.addons.base.ir.ir_http: Generating routing map
192.168.1.31 - - [2016-09-12 12:14:51] "GET / HTTP/1.1" 200 24082 21.358104
25138 INFO mydb openerp.addons.bus.models.bus: Bus.loop listen imbus on db postgres
This is my odoo9-server.conf (renamed openerp-server.conf):
[options]
admin_passwd = myAdminPass
db_host = False
db_port = False
db_user = myUserName
db_password = myDatabasePass
addons_path = /etc/odoo/server/addons,/etc/odoo/server/addons_extra
logfile = None
xmlrpc_port = 8069
log_level = debug
Is there something wrong?
To debug your odoo+python code in eclipse, start eclipse in debug perspective and follow the given steps:
1: Stop your Odoo running server by pressing "ctr+c".
2: In eclipse go to Menu "Run/Debug Configurations". In configuration window under "Python Run", create new debug configuration(Double click on 'Python Run').
3: After creating new debug configuration follow the given steps:
3.1: In "Main" tab under "Project", select the "server" project or folder (in which Odoo Server resides) from your workspace.
3.2: Write location of 'openerp-server' or 'odoo.py' under "Main Module".
Ex: ${workspace_loc:odoo/openerp-server}.
3.3: In "Arguments" tab under "Program Arguments", click on button "Variables" and new window will appear.
3.4: Then create new "Variable" by clicking on "Edit Variables" button and new window will appear.
3.5: Press on "New" button and give your addons path as value.
Ex: --addons ../addons,../your_module_path
3.6: Press Ok in all the opened windows and then "Apply".
4: Now into "PyDev Package Explorer" view go to odoo and right click on "openerp-server" or odoo.py file, Select 'Debug As --> Python Run'.
5: Now in "Console" you can see your server has been started.
6: Now open your .py file which you want to debug and set a break-point.
7: Now start your module's form from 'gtk' or 'web-client' and execution will stop when execution will reach to break-point.
8: Now enjoy by debugging your code by pressing "F5, F6, F7" and you can see value of your variables.
Source: https://stackoverflow.com/a/12298831/1312904
To invoke pdb, add this line
import pdb; pdb.set_trace() anywhere you want to set a breakpoint
and then start your odoo with the --debug flag set, something along the lines of
./odoo.py --addons=addons,myaddons --debug
and then when you execute an action on the server that hits the point where you invoked pdb, the execution will immediately stop and you'll have a pdb prompt that you can use to debug
Finally I got the solution.
In the Debug Configurations, I changed the content of Main Module and I wrote this:
${workspace_loc:my_project/openerp-gevent}
The important part is the openerp-gevent
Now, the debug works fine

Where to find logs for a cloud-init user-data script?

I'm initializing spot instances running a derivative of the standard Ubuntu 13.04 AMI by pasting a shell script into the user-data field.
This works. The script runs. But it's difficult to debug because I can't figure out where the output of the script is being logged, if anywhere.
I've looked in /var/log/cloud-init.log, which seems to contain a bunch of stuff that would be relevant to debugging cloud-init, itself, but nothing about my script. I grepped in /var/log and found nothing.
Is there something special I have to do to turn logging on?
The default location for cloud init user data is already /var/log/cloud-init-output.log, in AWS, DigitalOcean and most other cloud providers. You don't need to set up any additional logging to see the output.
You could create a cloud-config file (with "#cloud-config" at the top) for your userdata, use runcmd to call the script, and then enable output logging like this:
output: {all: '| tee -a /var/log/cloud-init-output.log'}
so I tried to replicate your problem. Usually I work in Cloud Config and therefore I just created a simple test user-data script like this:
#!/bin/sh
echo "Hello World. The time is now $(date -R)!" | tee /root/output.txt
echo "I am out of the output file...somewhere?"
yum search git # just for fun
ls
exit 0
Notice that, with CloudInit shell scripts, the user-data "will be executed at rc.local-like level during first boot. rc.local-like means 'very late in the boot sequence'"
After logging in into my instance (a Scientific Linux machine) I first went to /var/log/boot.log and there I found:
Hello World. The time is now Wed, 11 Sep 2013 10:21:37 +0200! I am
out of the file. Log file somewhere? Loaded plugins: changelog,
kernel-module, priorities, protectbase, security,
: tsflags, versionlock 126 packages excluded due to repository priority protections 9 packages excluded due to repository
protections ^Mepel/pkgtags
| 581 kB 00:00
=============================== N/S Matched: git =============================== ^[[1mGit^[[0;10mPython.noarch : Python ^[[1mGit^[[0;10m Library c^[[1mgit^[[0;10m.x86_64 : A fast web
interface for ^[[1mgit^[[0;10m
...
... (more yum search output)
...
bin etc lib lost+found mnt proc sbin srv tmp var
boot dev home lib64 media opt root selinux sys usr
(other unrelated stuff)
So, as you can see, my script ran and was rightly logged.
Also, as expected, I had my forced log 'output.txt' in /root/output.txt with the content:
Hello World. The time is now Wed, 11 Sep 2013 10:21:37 +0200!
So...I am not really sure what is happening in you script.
Make sure you're exiting the script with
exit 0 #or some other code
If it still doesn't work, you should provide more info, like your script, your boot.log, your /etc/rc.local, and your cloudinit.log.
btw: what is your cloudinit version?

Xdebug in Netbeans: not stopping on breakpoint inside file in "web root's" parent folder

I have a netbeans project with a directory tree like this:
<source folder>
|
|---> gui <web root folder>
| |
| L---> datos.php
|
L---> index.php
datos.php changes the working directory to .. (source folder) and includes index.php like this:
chdir('..');
require 'index.php';
If I put a breakpoint inside datos.php, the debugger breaks on it correctly, but when putting one in index.php it ignores it.
The strange thing is 6 months ago I had the same problem and I was able to fix it. Now I don't know why it stopped working and what I did back then to fix it.
More info:
xdebug log shows the following command for breakpoint setting:
breakpoint_set -i 315 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php -n 51
breakpoint_set -i 316 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/gui/datos.php -n 39
In both cases xdebug responds with state="enabled"
And if I debug manually, I can use the following command to set the breakpoint, which works:
breakpoint_set -i 315 -t line -s enabled -f file:///../index.php -n 51
But I don't know how could I make netbeans issue the breakpoint_set command with the same file:///../index.php argument and not file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php or any other way I can make this work.
Thanks in advance for any help!
You always can try using xdebug_break();
For example :
<?php
for ( $i=1, $j=0; $i<10; $i++) {
xdebug_break();
echo "<br>Line $i"; // will stop here
}
?>
will add a breakpoint in the following line.
Hope that helps a little...
Breakpoints are working again. I don't have any clues to why they didn't worked before but now they do. I can't remember doing any changes in xdebug or Netbeans either.
xdebug.log shows me the same as before, but now it stops at the setted breakpoint:
<- breakpoint_set -i 4 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php -n 51
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="4" state="enabled" id="14290001"></response>
<- run -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="5" status="break" reason="ok"><xdebug:message filename="file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php" lineno="51"></xdebug:message></response>
However, if anyone knows why this could had happend, sharing it could be helpful either way: probably me or someone else will be able to avoid having similar troubles in the future.
This issue is more specific to people who are using remote servers for their web apps.
I had the same problem. Xdebug ignores breakpoints really helped me however i have given solution more specific to netbeans, but the essence is the same, which ever IDE you are using. Just map your local project path with your remote server path.
My environment is WINDOWS 7 and website is hosted on UBUNTU VM. I am using NETBEANS from Windows 7 and has setup a remote project.
My xdebug logs
<- breakpoint_set -i 4 -t line -s enabled -f file:///C:/Users/ali/Documents/NetBeansProjects/test.com.au/cgen/src/Acme/TestBundle/Controller/CreateController.php -n 39
->
The real problem was the project path in netbeans [C:/Users/ali/Documents/NetBeansProjects/test.com.au] and the project path on the webserver. /home/ali/sites/test.com.au
Fix: In Netbeans click on your project > properties > Run Configuration > Advanced > Just put the appropriate server path and equivalent project path. It will work fine.
Same problem was solved by commenting xdebug.extended_info = 0. Also one may switch it to 1.
To get it to work again i changedxdebug.remote_host=127.0.0.1 to xdebug.remote_host=localhost in php.ini
below is my config for xdebuga
xdebug.remote_enable=1
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_autostart = 1
xdebug.show_local_vars = 1
xdebug.profiler_enable = 1
output_buffering=off
xdebug.idekey=netbeans-xdebug